The control data of the TEXTBOX is transmitted between the WebForm1 and the WebForm2 page, the code is as follows:
public class WebForm1: System.Web.UI.Page {protected System.Web.UI.WebControls.TextBox TextBox1; protected System.Web.UI.WebControls.TextBox TextBox2; protected System.Web.UI.WebControls.Button Button1; private void Page_load (Object Sender, System.EventAndargs E) {// Place the user code here to initialize the page}
Public String text1 {get {return this.textbox1.text;}}
Public string text2 {get {return this.textbox2.text;}}
#Region Web Form Designer Generated Code Override Protected Void OnNit (Eventargs E) {// // Codegen: This call is required for the ASP.NET Web Form Designer. // InitializeComponent (); base.onit (e);} ///
} #Endregion
Private void button1_click (object sender, system.eventargs e) {server.transfer ("Webform2.aspx");
Public class webform2: system.Web.ui.page {private void page_load (object sender, system.eventargs e) {// Place user code here to initialize page Webform1 WF1; WF1 = (WebForm1) contert.handler;
Response.write (wf1.text1 wf1.text2);}
#Region Web Form Designer Generated Code Override Protected Void OnNit (Eventargs E) {// // Codegen: This call is required for the ASP.NET Web Form Designer. // InitializeComponent (); base.onit (e);} ///