ASP » Request » QueryString

Syntax:
Request.QueryString (Variable)[(Index)|.Count]
Variable
The Variable specifies the name of the variable in the query string whose value is to be retrieved.
Index
The optional Index argument is used when the Variable argument has more than one value. It is an integer, ranging from 1 to Request.QueryString(Variable).Count, which is used to select values from the Variable. Count is the total number of multiple values.

The QueryString collection property contains the values of the variables in the HTTP query string, which are the statements that follow a question mark.

The QueryString collection property contains, and allows you to retrieve, the values of the variables in the query string which are the statements that follows a question mark. Many different processes can produce a query string such as an anchor tag, a form submission, or typing the string into the address box of the browser.

You can iterate through a collection using a For Each item in ... Next loop.

There is one mandatory argument and one optional argument.

Examples

Code:
-----------------------File1.asp----------------------
<HTML>
<HEAD>
</HEAD>
<BODY>
<A HREF="File2.asp?language=ASP&type=general">Query sample</A>
</BODY>
</HTML>
 
-----------------------File2.asp----------------------
<%
For Each item In Request.QueryString
    Response.Write(item & " = " & Request.QueryString(item) & VbCrLf)
Next
%>
Output:
language = ASP
type = general