For passing variables content between pages ASP.NET gives us several choices.
One choice is using
Put this code to your submit button event handler.
Response.Redirect("SparePartItemReport.aspx?OrderNo=" + txtOrderNo.Text + "&Status=Inventoried");
Our first code part builds a query string for your application and send contents of your textboxes to second page. Now how to retrieve this values from second page. Put this code to second page
if (Request.QueryString["OrderNo"] != null && Request.QueryString["OrderNo"].ToString() != "" && Request.QueryString["Status"] != null && Request.QueryString["Status"].ToString() != "")
{
string OrderNo = Request.QueryString["OrderNo"].ToString();
string Status = Request.QueryString["Status"].ToString();
}
QueryString
property of Request
Object.Put this code to your submit button event handler.
Response.Redirect("SparePartItemReport.aspx?OrderNo=" + txtOrderNo.Text + "&Status=Inventoried");
Our first code part builds a query string for your application and send contents of your textboxes to second page. Now how to retrieve this values from second page. Put this code to second page
page_load
. if (Request.QueryString["OrderNo"] != null && Request.QueryString["OrderNo"].ToString() != "" && Request.QueryString["Status"] != null && Request.QueryString["Status"].ToString() != "")
{
string OrderNo = Request.QueryString["OrderNo"].ToString();
string Status = Request.QueryString["Status"].ToString();
}