Answer:
FirstForm.aspx
<asp:Button id="buttonPassValue" runat="server" Text="Button" PostBackUrl="~/SecondForm.aspx">
</asp:Button>
SecondForm.aspx.cs
TextBox1.Text = Request.Form["TextBox1"].ToString();
Or SecondForm.aspx.cs
TextBox textBoxTemp = (TextBox) PreviousPage.FindControl("TextBox1");
TextBox1.Text = textBoxTemp.Text;
As you’ve noticed, this is a simple and clean implementation of passing values between pages.
<asp:Button id="buttonPassValue" runat="server" Text="Button" PostBackUrl="~/SecondForm.aspx">
</asp:Button>
SecondForm.aspx.cs
TextBox1.Text = Request.Form["TextBox1"].ToString();
Or SecondForm.aspx.cs
TextBox textBoxTemp = (TextBox) PreviousPage.FindControl("TextBox1");
TextBox1.Text = textBoxTemp.Text;
As you’ve noticed, this is a simple and clean implementation of passing values between pages.
Previous Question | Next Question |
How to use Context? | How to use Server.Transfer in dot net? |