Open In App

ASP Request.QueryString Collection

The ASP Request.QueryString Collection is used to get the value of the variable that will be stored in the HTTP query string from the URL. 

The  Query string is a part of the URL that begins with a question mark (?). Generally, it contains the information of the user. 



<a href= “geek.asp?txt=this is a query string test”>Link with a query string</a> 

Syntax

Request.QueryString(variable)[(index)|.Count] 

Parameter Values:



 

Example: Below ASP code returns all the values of the variable from the following Request Query String. 

The following request is sent: 

https://www.GeeksForGeeks.org/sudo/geeks.asp?x=Manas&x=Sushant




<%
for i=1 to Request.QueryString("x").Count
  Response.Write(Request.QueryString("x")(i) & "<br>")
next
%>

Output 

Manas
Sushant
Article Tags :