Steven Steven - 2 months ago 22
ASP.NET (C#) Question

Retrieve GET variables from URL in ASPX

What's the easiest / standard way to retrieve the GET (in URL) variables passed to a .aspx (VB) page?

Answer Source

You can use the following:

http://www.whatever.com?hello=goodbye&goodbye=hello

string value = Request.QueryString("hello"])

Value will be goodbye

or

foreach(string key in Request.QueryString)
{
    Response.write(Request.QueryString[key])
}