Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

QueryString

ASP 101

QueryString

by  Bullschmidt  Posted    (Edited  )
Example URL with a querystring:
http://www.mysite.com/mydir/mypg.asp?myvar1=hey&myvar2=ho

Because a variable might contain some odd characters like spaces, it's usually a good idea to use Server.URLEncode when creating a querystring from a variable:
<a href="http://www.mysite.com/mypage?id=<%=Server.URLEncode(objRS("MyIDFldFromDB")) %>">objRS("MyIDFldFromDB")</a>

And in the page that is opened you can use Request.QueryString("id") to get the value of id.

Best regards,
J. Paul Schmidt - Freelance ASP Web Developer
www.Bullschmidt.com - Creating "dynamic" Web pages that read and write from databases...
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top