how to send some information from one web form to another web form in asp.net
first web form is HumanList.aspx
that shows the list of humans in a GridView
Well, there are many ways to pass information page to page.
one primary way is by QueryString
//To Send
private void submit_Click(object sender, System.EventArgs e)
{
string ID = String.Empty;
ID = "192" // Have your ID Here
Response.Redirect("humanEdit.aspx?ID=" + ID );
}
//To Receive
private void Page_Load(object sender, System.EventArgs e)
{
String ID = String.Empty;
ID=Request.QueryString["name"];
}
Another Method is Sessions
//Store your ID from Sending Page
Session["ID"]= "143"; //Example ID
//To Recieve
private void Page_Load(object sender, System.EventArgs e)
{
String ID = String.Empty;
ID=Session["ID"].toString();
}
And there are many other ways too...