Saturday, December 29, 2012

How to pass multiple parameters in query string in ASP.NET


In my previous post i have showed you how to pass and read a single query string. Below code can be used to pass multiple parameters in URL query string.

Response.Redirect("Page1.aspx?Name=Chamara&Country=Sri Lanka");

Read parameters.

Response.Write(Request.QueryString["Name"].ToString()+"<br/>");
Response.Write(Request.QueryString["Country"].ToString());

Output:
Chamara
Sri Lanka

No comments:
Write comments
Recommended Posts × +