QueryString

You often need to pass parameters from one page to another. You may offer users a list of hyperlink choices. The hyperlinks might all go to the same page. To give the destination page enough information so that it can determine the correct action for each request, parameters may be submitted.

For ASP.NET applications, parameters are appended to the destination document’s URL. Immediately after the URL, a ? character is added to indicate that there are indeed parameters. Then for each parameter, there is a name and a value, such as "Flavor=Chocolate". Each parameter must be separated by a & character.

Using Parameters

The following hyperlink goes to Process.aspx, and has two parameters: Name and Address:

 <a href=”Process.aspx?Name=Sam&Address=123%20Main%20Street”>Sam</a> ...

Get Special Edition Using® Microsoft® ASP.NET now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.