Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

ASP Request.QueryString Collection

  • Last Updated : 01 Dec, 2021

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:

  • variable: It is a required attribute. It defines the name of the variable in the HTTP Query String.
  • index: It is an optional parameter. It defines one of the multiple values for a variable. which varies From 1 to Request.QueryString(variable).Count

 

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

Geeks.asp




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

Output 

Manas
Sushant
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!