Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Displaying User Specific Data (based on user input)

Displaying User Specific Data (based on user input)

Scheduled Pinned Locked Moved ASP.NET
csharpdatabaseasp-netvisual-studiotutorial
11 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ahayw01
    wrote on last edited by
    #1

    Hello, I have an ASP.NET website with a sql backend. I am utilizing the membership provider model within visual studio. The site can only be accessed by entering the correct username and password. I have approximately 20 pdfs on the website. I need to be keep a log of who has "read" which documents. I am creating a page that lists all documents to be read. I have a check box before each url. The user will need to check off which documents he/she has read and then submit the page. When the user clicks on the link again to see the remaining documents to be read, the page should only display those documents that the user has not yet checked off. I can store the document list in a sql database but I am not certain how to maintain the log of documents for each user and how to only display the list of those documents that have not yet been read. Any thoughts or assistance would be appreciated. Also if there is more efficient way to do this please let me know. Thank you in advance for your assistance. Allison

    C N D 3 Replies Last reply
    0
    • A ahayw01

      Hello, I have an ASP.NET website with a sql backend. I am utilizing the membership provider model within visual studio. The site can only be accessed by entering the correct username and password. I have approximately 20 pdfs on the website. I need to be keep a log of who has "read" which documents. I am creating a page that lists all documents to be read. I have a check box before each url. The user will need to check off which documents he/she has read and then submit the page. When the user clicks on the link again to see the remaining documents to be read, the page should only display those documents that the user has not yet checked off. I can store the document list in a sql database but I am not certain how to maintain the log of documents for each user and how to only display the list of those documents that have not yet been read. Any thoughts or assistance would be appreciated. Also if there is more efficient way to do this please let me know. Thank you in advance for your assistance. Allison

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      This sounds messy to me. If I check an item, it disappears from the list ? I would have thought you would allow users to request a document they have viewed before, and that you'd track what they read automatically, through what documents they requested from your system. I would expect you're going to store in the DB which ones were marked read, then run SQL to request the unread ones to view.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      A 1 Reply Last reply
      0
      • C Christian Graus

        This sounds messy to me. If I check an item, it disappears from the list ? I would have thought you would allow users to request a document they have viewed before, and that you'd track what they read automatically, through what documents they requested from your system. I would expect you're going to store in the DB which ones were marked read, then run SQL to request the unread ones to view.

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        A Offline
        A Offline
        ahayw01
        wrote on last edited by
        #3

        Christian, Thanks for your quick reply. You bring up a good point, I see that I probably did not clarify this as well as I should. The list of documents that need to be read is a separate page that serves as a central location to store all those documents that still need to be confirmed as being read (by the user). This list contains the name of the document, a link to the document and checkbox that is to be checked once the document is read. The documents are located on a variety of pages throughout the site. Hopefully that helps. Sorry for the initial confusion. Allison

        C 1 Reply Last reply
        0
        • A ahayw01

          Christian, Thanks for your quick reply. You bring up a good point, I see that I probably did not clarify this as well as I should. The list of documents that need to be read is a separate page that serves as a central location to store all those documents that still need to be confirmed as being read (by the user). This list contains the name of the document, a link to the document and checkbox that is to be checked once the document is read. The documents are located on a variety of pages throughout the site. Hopefully that helps. Sorry for the initial confusion. Allison

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          OK - I still think that you should be detecting when a document is requested, and marking it as read as a result, and letting the user view ALL documents in order to select which ones to mark as read ( so they can unmark some ). From there, if you have them marked as read in the DB, it's easy to write SQL that returns the list of unread documents, so you can display that.

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          A 1 Reply Last reply
          0
          • C Christian Graus

            OK - I still think that you should be detecting when a document is requested, and marking it as read as a result, and letting the user view ALL documents in order to select which ones to mark as read ( so they can unmark some ). From there, if you have them marked as read in the DB, it's easy to write SQL that returns the list of unread documents, so you can display that.

            Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

            A Offline
            A Offline
            ahayw01
            wrote on last edited by
            #5

            Christian, Thanks that makes perfect sense, however (per the requirements provided to me), I need for the user to actually check a box or something to confirm that they have read the document. I really appreciate your help. Allison

            C 1 Reply Last reply
            0
            • A ahayw01

              Christian, Thanks that makes perfect sense, however (per the requirements provided to me), I need for the user to actually check a box or something to confirm that they have read the document. I really appreciate your help. Allison

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              Has anyone gone over the requirements with the client, or are they allowed to invent anything and you're not allowed to offer feedback ? In any case, you can do this easy enough, just define a column that has a checkbox in a gridview that you display, then check which ones were checked, on postback. http://www.codeproject.com/info/search.aspx?artkw=gridview+checkbox[^] There seems to be a lot of CP articles on how to use checkboxes inside a gridview, I'd say you need to start there. It's a while since I've done this sort of thing, and I am sure that an article with downloadable code will help you more than any comments I might make in a forum reply.

              Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

              A 1 Reply Last reply
              0
              • C Christian Graus

                Has anyone gone over the requirements with the client, or are they allowed to invent anything and you're not allowed to offer feedback ? In any case, you can do this easy enough, just define a column that has a checkbox in a gridview that you display, then check which ones were checked, on postback. http://www.codeproject.com/info/search.aspx?artkw=gridview+checkbox[^] There seems to be a lot of CP articles on how to use checkboxes inside a gridview, I'd say you need to start there. It's a while since I've done this sort of thing, and I am sure that an article with downloadable code will help you more than any comments I might make in a forum reply.

                Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                A Offline
                A Offline
                ahayw01
                wrote on last edited by
                #7

                Christian, This is an in-house project and the criteria has already been determined and laid out beforehand. Thanks again for your quick reply and your help, I really appreciate it. I will check out the information that you provided. Allison

                1 Reply Last reply
                0
                • A ahayw01

                  Hello, I have an ASP.NET website with a sql backend. I am utilizing the membership provider model within visual studio. The site can only be accessed by entering the correct username and password. I have approximately 20 pdfs on the website. I need to be keep a log of who has "read" which documents. I am creating a page that lists all documents to be read. I have a check box before each url. The user will need to check off which documents he/she has read and then submit the page. When the user clicks on the link again to see the remaining documents to be read, the page should only display those documents that the user has not yet checked off. I can store the document list in a sql database but I am not certain how to maintain the log of documents for each user and how to only display the list of those documents that have not yet been read. Any thoughts or assistance would be appreciated. Also if there is more efficient way to do this please let me know. Thank you in advance for your assistance. Allison

                  N Offline
                  N Offline
                  N a v a n e e t h
                  wrote on last edited by
                  #8

                  Hi Allison,

                  ahayw01 wrote:

                  I have a check box before each url. The user will need to check off which documents he/she has read and then submit the page.

                  This is not a good idea in my opinion. Document will be still shown in the documents to read area when user reads the documents and not check off the check box. Automating this would be a nice idea. You can make use of a Http handler and hook one for PDF extension. You only need to show the PDF link to the user without any check box. When user clicks on a PDF file link, this handler will be executed and it will do the logging.

                  ahayw01 wrote:

                  I can store the document list in a sql database but I am not certain how to maintain the log of documents for each user and how to only display the list of those documents that have not yet been read.

                  You may need two tables. One for storing the available documents and one for logging the users read activities. Here is a sample. Master table - Documents - DocumentId - A unique id to identify each document - DisplayName - Text displayed to user - PDFFileName - PDF file name Transaction table - UserReadActivity - UserId - DocumentId - Foreign key referring Documents table You can easily get all the documents that a user has to read by using the query

                  SELECT *
                  FROM Documents
                  WHERE DocumentId Not IN (SELECT DocumentId FROM UserReadActivity WHERE UserId = YourUserId);

                  It will be good to show the documents that are already read if user is allowed to reread. It can be achieved by joining the both tables. Hope that helps. :)

                  Navaneeth How to use google | Ask smart questions

                  A 1 Reply Last reply
                  0
                  • A ahayw01

                    Hello, I have an ASP.NET website with a sql backend. I am utilizing the membership provider model within visual studio. The site can only be accessed by entering the correct username and password. I have approximately 20 pdfs on the website. I need to be keep a log of who has "read" which documents. I am creating a page that lists all documents to be read. I have a check box before each url. The user will need to check off which documents he/she has read and then submit the page. When the user clicks on the link again to see the remaining documents to be read, the page should only display those documents that the user has not yet checked off. I can store the document list in a sql database but I am not certain how to maintain the log of documents for each user and how to only display the list of those documents that have not yet been read. Any thoughts or assistance would be appreciated. Also if there is more efficient way to do this please let me know. Thank you in advance for your assistance. Allison

                    D Offline
                    D Offline
                    droth17
                    wrote on last edited by
                    #9

                    Create a log table that has it's keys setup to be the userid and the documentid. When they click on the submit button, loop through the checkboxes and add a value (check for duplicates) into this log table. Then, just run a simple query joining your document table with the log table to get those records that have not been viewed. This is pretty basic coding, so if this is above your head go to the library and get a decent book, there will be many examples on this type of question.

                    A 1 Reply Last reply
                    0
                    • D droth17

                      Create a log table that has it's keys setup to be the userid and the documentid. When they click on the submit button, loop through the checkboxes and add a value (check for duplicates) into this log table. Then, just run a simple query joining your document table with the log table to get those records that have not been viewed. This is pretty basic coding, so if this is above your head go to the library and get a decent book, there will be many examples on this type of question.

                      A Offline
                      A Offline
                      ahayw01
                      wrote on last edited by
                      #10

                      Hello, Thank you for your response. Setting up the log table as you suggested makes perfect sense. This seems very feasible and not over my head, so thanks again. Allison

                      1 Reply Last reply
                      0
                      • N N a v a n e e t h

                        Hi Allison,

                        ahayw01 wrote:

                        I have a check box before each url. The user will need to check off which documents he/she has read and then submit the page.

                        This is not a good idea in my opinion. Document will be still shown in the documents to read area when user reads the documents and not check off the check box. Automating this would be a nice idea. You can make use of a Http handler and hook one for PDF extension. You only need to show the PDF link to the user without any check box. When user clicks on a PDF file link, this handler will be executed and it will do the logging.

                        ahayw01 wrote:

                        I can store the document list in a sql database but I am not certain how to maintain the log of documents for each user and how to only display the list of those documents that have not yet been read.

                        You may need two tables. One for storing the available documents and one for logging the users read activities. Here is a sample. Master table - Documents - DocumentId - A unique id to identify each document - DisplayName - Text displayed to user - PDFFileName - PDF file name Transaction table - UserReadActivity - UserId - DocumentId - Foreign key referring Documents table You can easily get all the documents that a user has to read by using the query

                        SELECT *
                        FROM Documents
                        WHERE DocumentId Not IN (SELECT DocumentId FROM UserReadActivity WHERE UserId = YourUserId);

                        It will be good to show the documents that are already read if user is allowed to reread. It can be achieved by joining the both tables. Hope that helps. :)

                        Navaneeth How to use google | Ask smart questions

                        A Offline
                        A Offline
                        ahayw01
                        wrote on last edited by
                        #11

                        Navaneeth, Thanks for your response. The solution that you proposed is great and automating this makes perfect sense. Unfortunately, I need to be able display the list of documents that need to be read and have the user check the box, confirming that he/she has read the document. I am sure I will be able to use what you proposed in my future projects. Thanks again, Allison

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups