3) Session Variables
When the user submits the form you can store the values in session variables and then load them up on the next page.
<script language="VB" runat="server"> Sub Do_page1(sender as object, e as EventArgs) Session.Contents("name") = name.Text Response.Redirect("mpf3.aspx") End Sub </script> <form runat="server"> Enter your name: <asp:textbox id="name" runat="server" /><br> <asp:button text="Next Page" runat="server" OnClick="Do_page1" /> </form> |
Page 1 -Live Demo |
<script language="VB" runat="server"> Sub page_load(sender as object, e as EventArgs) Dim name = Session.Contents("name") End Sub
Sub Do_page2(sender as object, e as EventArgs) Session.Contents("city") = city.Text Response.Redirect("mpf4.aspx") End Sub </script> <form runat="server"> What city do you live in <%=name%>? <asp:textbox id="city" runat="server" /><br> <asp:button text="Next Page" runat="server" OnClick="Do_page2" /><p> </form> |
Page 2 -Live Demo |
Thanks <%=Session.Contents("name")%>, I hope it's nice in <%=Session.Contents("city")%>. |
Page 3 -Live Demo |