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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Using URL to link to a page, and load from a database using values in the URL

Using URL to link to a page, and load from a database using values in the URL

Scheduled Pinned Locked Moved ASP.NET
csharpdatabasetutorialasp-net
4 Posts 3 Posters 1 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.
  • R Offline
    R Offline
    Ragonastick
    wrote on last edited by
    #1

    Hi guys Before You read this I just wanted to inform you I am using Visual Studio 2003, VB.Net as the codebehind, and running asp.net 1.1 I am currently developing an asp.net webpage where a user can input data, and then it will save that data to a Microsoft SQL Server database. The table in this database that I am saving has an ID field which I use as the primary key. The next bit of information is when the data has been inputted, and submitted it will send an email to a person which would need to view the data. This email that I want to send is a link to the data which was inputted by the user. I was wondering if it is possible to send a link to someone with the ID field of the inputted data in the URL of the link, and then have that person be able to open the link and retrieve data from the database. Example www.MyHours.com\timesheet\ will load up a blank timesheet for the user(Lets say his name is John) to fill out. John fills out the data, and that row in the database which has an ID of 1235, Next an email is sent out to the person(lets call this person Mary) , and she needs to view the timesheet. The URL that is sent to here www.MyHours.com\timesheet\id=1235, Then Todd fills out the data, and a new row in the database is created with an ID of 1236, and another link is sent to Mary With the url www.MyHours.com\timesheet\id=1236 which she can then click on, and view the data Todd had inputted. If anyone knows how to do this or can just point me in the write direction on how to do this it would be greatly appreciated.

    Y D 2 Replies Last reply
    0
    • R Ragonastick

      Hi guys Before You read this I just wanted to inform you I am using Visual Studio 2003, VB.Net as the codebehind, and running asp.net 1.1 I am currently developing an asp.net webpage where a user can input data, and then it will save that data to a Microsoft SQL Server database. The table in this database that I am saving has an ID field which I use as the primary key. The next bit of information is when the data has been inputted, and submitted it will send an email to a person which would need to view the data. This email that I want to send is a link to the data which was inputted by the user. I was wondering if it is possible to send a link to someone with the ID field of the inputted data in the URL of the link, and then have that person be able to open the link and retrieve data from the database. Example www.MyHours.com\timesheet\ will load up a blank timesheet for the user(Lets say his name is John) to fill out. John fills out the data, and that row in the database which has an ID of 1235, Next an email is sent out to the person(lets call this person Mary) , and she needs to view the timesheet. The URL that is sent to here www.MyHours.com\timesheet\id=1235, Then Todd fills out the data, and a new row in the database is created with an ID of 1236, and another link is sent to Mary With the url www.MyHours.com\timesheet\id=1236 which she can then click on, and view the data Todd had inputted. If anyone knows how to do this or can just point me in the write direction on how to do this it would be greatly appreciated.

      Y Offline
      Y Offline
      Yusuf
      wrote on last edited by
      #2

      you can reuse the blank timesheet page to reload user data when they pass you an id. Instead of showing a blank page, query your database and load the data in the page. Request.QueryString[^]

      Ragonastick wrote:

      www.MyHours.com\timesheet\id=1235,

      this needs to be www.myhours.com\timesheet?id=1235

      Yusuf Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]

      1 Reply Last reply
      0
      • R Ragonastick

        Hi guys Before You read this I just wanted to inform you I am using Visual Studio 2003, VB.Net as the codebehind, and running asp.net 1.1 I am currently developing an asp.net webpage where a user can input data, and then it will save that data to a Microsoft SQL Server database. The table in this database that I am saving has an ID field which I use as the primary key. The next bit of information is when the data has been inputted, and submitted it will send an email to a person which would need to view the data. This email that I want to send is a link to the data which was inputted by the user. I was wondering if it is possible to send a link to someone with the ID field of the inputted data in the URL of the link, and then have that person be able to open the link and retrieve data from the database. Example www.MyHours.com\timesheet\ will load up a blank timesheet for the user(Lets say his name is John) to fill out. John fills out the data, and that row in the database which has an ID of 1235, Next an email is sent out to the person(lets call this person Mary) , and she needs to view the timesheet. The URL that is sent to here www.MyHours.com\timesheet\id=1235, Then Todd fills out the data, and a new row in the database is created with an ID of 1236, and another link is sent to Mary With the url www.MyHours.com\timesheet\id=1236 which she can then click on, and view the data Todd had inputted. If anyone knows how to do this or can just point me in the write direction on how to do this it would be greatly appreciated.

        D Offline
        D Offline
        David Mujica
        wrote on last edited by
        #3

        I think what you want to do is send in your email something like this: http://myserver/myapp/MyPage.aspx?ID=68 Then in your page_load event, you could use the following to get the ID. myParam = Request.QueryString("ID") In the above example, it would return 68, which you could then use to perform a database lookup.

        R 1 Reply Last reply
        0
        • D David Mujica

          I think what you want to do is send in your email something like this: http://myserver/myapp/MyPage.aspx?ID=68 Then in your page_load event, you could use the following to get the ID. myParam = Request.QueryString("ID") In the above example, it would return 68, which you could then use to perform a database lookup.

          R Offline
          R Offline
          Ragonastick
          wrote on last edited by
          #4

          Thanks

          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