SecondForm.aspx.cs ..." /> How To Use PreviousPage On Web Forms? SecondForm.aspx.cs ..." /> SecondForm.aspx.cs ..." />
Answers

Question and Answer:

  Home  Microsoft Web Forms

⟩ How to use PreviousPage on web forms?

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.

 188 views

More Questions for you: