Jump to B.aspx in a.aspx
The difference between Server.Transfer ("b.aspx") and Response.Redirect ("b.aspx")
If you are jumping to b.aspx in a.aspx by Server.Transfer (), on the B.aspx page, you can find the value in the control that is saved in the A.aspx page, if it is Response.Redirect (), You cannot get the value of the control in the A.aspx page.
If you are passing Server.Transfer ("b.aspx"), you can tell the following ways to get values that remain in a.aspx such as Label,hiddenfield
Copy Code code as follows:
HiddenField Hforderid = new HiddenField ();
HiddenField Hfpaymoney = new HiddenField ();
if (page.previouspage!= null)
{
Try
{
//
//Find master page,
MasterPage MasterPage = (MasterPage) Page.previouspage.controls[0];
//
//Find container
ContentPlaceHolder ContentPlaceHolder = (ContentPlaceHolder) Masterpage.findcontrol (" ContentPlaceHolder3 ");
System.Web.UI.UserControl UserControl = (System.Web.UI.UserControl) contentplaceholder.findcontrol ("MyOrder1") ;
//
//Find the corresponding data transfer HiddenField
Hforderid = (HiddenField) usercontrol.findcontrol ("Hforderid");
Hfpaymoney = (HiddenField) usercontrol.findcontrol ("Hfpaymoney");
//
//Get the Incoming order number
String strorderid = Hforderid.value;
String Strpaymoney = Hfpaymoney.value;
}
}