6
Reply

What is syntax for implementing Query string in ASP .NET?

Sandeep Kumar

Sandeep Kumar

8y
1.6k
0
Reply

    QueryString property of Request Object. When surfing internet you should have seen weird internet address such as one below. http://www.localhost.com/Webform2.aspx?name=Atilla&lastName=Ozgur

    Syntax: To send single parameter to another page we need to write code like this: "Requested Page URL" ? "Variable name" = "Value". Example: Response.Redirect("Default2.aspx?UserId=SH531828");Example to send multiple parameters to another page we need to write code like this:Response.Redirect("Default2.aspx?UserId=SH531828 & UserName=Shraban");

    To pass data from one page to another we use query string.Its basically a key value pair.Syntax is Response.Redirect("Page2.aspx?id=1&name=test"); .On the second page we can get it as string name=Request.QueryString["name"].ToString();

    QueryString property of Request Object. When surfing internet you should have seen weird internet address such as one below. http://www.localhost.com/Webform2.aspx?name=Atilla&lastName=Ozgur

    QueryString property of Request Object. When surfing internet you should have seen weird internet address such as one below.http://www.localhost.com/Webform2.aspx?name=Atilla&lastName=Ozgur

    The syntax for implementing Query string in ASP .NET is Response.Redirect("Requested page.aspx ?"Key=value)