Multi-Page Forms
page 6 of 6
by . .
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 30341/ 84

Method 5 - Context

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
End Sub
<form runat="server">
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.

Last Page

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

View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2023  |  Page Processed at 2023-09-23 7:43:36 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search