How to use QueryString?

By Goniey N (Mr. G)

Give Idea About That How To Use The Query String in The C# To get The value From One Form To Another Form...

//In "Source.aspx" On Button Click Event
private void BtnGo_Click (object sender, System.EventArgs e)
{
string URL;
//Store Whole Querystring Into The URL String Variable...
URL="YourQueryStringForm.aspx?UName=" + txtUName.Text + "&Email=" + txtEmail.Text;
Response.Redirect(URL);
}



//In "Destination.aspx" On Page Load Event
private void Page_Load (object sender, System.EventArgs e)
{
//Store Value Of UName Into LblUName Lable
LblUName.Text=Request.QueryString["UName"];
//Store Value Of Email Into LblEmail Lable
LblEmail.Text=Request.QueryString["Email"];
}

How to use QueryString?  (875 Views)