Monday 6 May 2013

Query String Parameters

Query String parameters to pass values from one page to another page. Query string parameters are created by using ? symbol at the end of the url while navigating to a page. Next to the ? symbol, specify the parameter name followed by= operator  followed by the value to pass using that parameter. When, you have multiple parameters then seperate them with & symbol.

Server.Trnasfer("~/page2,aspx? pname=value& pname=value");

To read query string parameters, use QueryString property of Request object.

Varname=Request.QueryString["pname"];