Click to See Complete Forum and Search --> : ASP dynamic lookup based on hyperlink parameter?


karlastell
05-25-2007, 11:42 AM
Hello everyone! I am struggling to find a way to send a parameter to an ASP.net web page through a clicked hyperlink so that the ASP page picks up the parameter from the hyperlink and does a database query based on the parameter.

In simple language, a user gets an email that I can generate that has a hyperlink in it something like this:

http://myserver/lookup.aspx?recordnum=20

When the user clicks this link, I want them to be directed to my aspx webpage and have the webpage do my sql database lookup and find only the record where the recordnum=20.

I can get my aspx page to show all records or I can hard code it to only show record 20, but how do I get the page to see the incoming "recordnum=20" from the hyperlink?
:confused:

nathanb
05-25-2007, 11:11 PM
In ASP Classic You can check the value of a string passed through a URL by using Request.QueryString("name").

So in your case, you would use Request.QueryString("recordnum"). I'm not sure if it works the same in ASP.NET, but it's worth a try.