Request Object
All Objects
All Collections
COLLECTION PROPERTY: Request.QueryString
Request.
QueryString
(Variable)[(Index)|.Count]
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.
Variable
The
Variable
specifies the name of the variable in the query string whose value is to be retrieved.
There is one optional argument.
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.
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
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information