Cross-page posting enables you to submit a form (suppose, Page1.aspx) and have this
form and all the control values post themselves to another page (suppose, Page2.aspx). now you can get values of all controls on one web form from other web form
How to do this practically
Add a new website in visual studio 2005 and add two web form (suppose page1.aspx and page2.aspx)
Page1.aspx
Add two controls in this page from tool box, one textbox and one button
PostBackUrl=”Page2.aspx”/
Page2.aspx
protected void Page_Load(object sender, System.EventArgs e)
{
TextBox pp_Textbox1;
pp_Textbox1 = (TextBox)PreviousPage.FindControl(“Textbox1”);
Label1.Text = “Hello “ + pp_Textbox1.Text;
}
No comments:
Post a Comment