5) Using the Context object
This idea was submitted to me by Kirk Jackson, Thanks!
The context object is a variable that is initalized at the start of each request and will last until the end of the request. You can store items in this object and then transfer the page using Server.Transfer.
Page 1 -
|<script language="VB" runat="server">|
Sub Do_page1(sender as object, e as EventArgs)
Context.Items("Name") = name.Text
Enter your name: <asp:textbox id="name" runat="server" /><br>
<asp:button text="Next Page" runat="server" OnClick="Do_page1" />
This would store it and sent it along.
|Thanks <%=Context.Items("Name")%>, I hope it's nice in <%=Context.Items("City")%>.|
Well, you have learnt the ways to work-around that annoying 'Always-post-back' problem in ASP.NET