How to send data from one page to another using QueryString ?

Bharathi Cherukuri
Posted by Bharathi Cherukuri under ASP.NET category on | Points: 40 | Views : 2071
Below is the code snippet to send data from one page to another using QueryString.


//Code to send query strings FName and LName as part of the URL
QueryStrings2.aspx?FName=David&LName=Boon

protected void Page_Load(object sender, EventArgs e)
{
//Code to read Query String values
string FirstName = Request.QueryString["FName"];
string LastName = Request.QueryString["LName"];
Response.Write("Data from QueryStrings1.aspx : " + FirstName + ", " + LastName);
}

Comments or Responses

Login to post response