How to use Query String using asp.net

How to use Query String using asp.net(C#)

Introduction : This Tutorial explain how to use query string in asp.net using Query string we can pass some data or information from one page to another page using the Url.

Step 1: In Form1 we can write the following code in button event

 da.Name = TextBox1.Text;
 Response.Redirect("WebForm2.aspx?name=" +TextBox1.Text); 

Step 2 : In Form2  we can retrieve the values of the first page to second page using the Url above this code can write page load event of second page
     
              label1.Text = Request.QueryString["name"];

using this tutorial we can maintain some data from one page to another page
Previous
Next Post »