Using query strings in ASP pages  

Helping others realize their vision.

 

Copyright 1996-2015 Pelt Industries.
All Rights Reserved.

 

   Logout  
 

Back
Next

Home

About Us
News
Info Center
PC Medic
Automation
Training
Products
Services
Contents
Support
Search
Contact us

 


Using Query Strings in ASP pages

Most web surfers are familiar with the use of URLs (Universal Resource Locator strings), which are used to give a name to a web page. For example, www.microsoft.com. The full syntax for a URL is actually http://www.microsoft.com You must include the http:// to make sure you are referring to a web page rather than for example an FTP site such as ftp://mircosoft.com.

What puzzles most people is seeing a URL with a question mark followed by a lot of weird characters in many cases. Everything that follows the question mark in a URL is called "the query string" for that page. Query strings allow a web page to be customized. The query string itself consists of a sequence of 'name=value' pairs separated by ampersands.

In an ASP page, you can refer to the values passed in the query string, by using the syntax:

<%= Request.QueryString("name")%>

The above syntax will be substituted by the ASP web server with the actual value passed in the query string by the invoking web page. If the query string did not specify a value for the indicated name, a null string will be inserted.

 

 

 

For questions, problems or suggestions on this web site please contact our webmaster Markus Pelt
Copyright 1996-2008 Pelt Industries. All Rights Reserved.
Last modified: March 26, 2015