i am just trying the example of cross page posting. i have added 1 textbox & 1 button to default.aspx page
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button2" runat="server" Text="Button" PostBackUrl="~/About.aspx"/>
i have added following code to code-behind file of about.aspx page
protected void Page_Load(object sender, EventArgs e)
{
if (Page.PreviousPage != null)
{
TextBox SourceTextBox =
(TextBox)Page.PreviousPage.FindControl("TextBox1");
if (SourceTextBox != null)
{
Label1.Text = SourceTextBox.Text;
}
else
Label1.Text = "no value";
}
else
Label1.Text = "no value from previous page";
}
when i enters some text in textbox1 & clicks button, it goes to about.aspx but label shows value "no value", its not showing textbox1's text value, why this is not working properly?