Context.Items.Add & server.transfer problems help.

binici

Active member
Joined
Sep 11, 2006
Messages
26
Programming Experience
Beginner
Hello all:

I was doing some testing and have a few problem, which leads to a simple question (hopefully).

I have a memberapp.aspx page, which is a general application, when the users fills the form out, they click a Next button to go to another page. The second page is called, orientation_agreement, they fill out another simple form and can choose to either go Back or Submit the form.

Now, I am using:

VB.NET:
Context.Items.Add("fname", member_first_name.Text)
Server.Transfer("orientation_agreement.aspx")

on the first page to collect the values of the first form to the second page and have them as so:

VB.NET:
Dim strFirstName As String
Dim strFirstName = context.Items("fname")
textboxexamplename.text = strFirstName

on the second page.

Then, when the users click submit I want to collect the values of the form from the first page + second page and insert them into my sql statement and MailMessage object, but when i test right now, the values from the first page are empty.

When I write out the values to a label or textbox on the second page the values are present?

Am I missing something?
confused.gif


Thank you!
 
Last edited by a moderator:
The wizard control was introduced in ASP.NET 2.0 to make collecting several "pages" of information more managable. With the wizard control, you can create multiple steps to collect information and the wizard control handles the state information for the different steps making all the controls in all the steps easily available.
 
The wizard control was introduced in ASP.NET 2.0 to make collecting several "pages" of information more managable. With the wizard control, you can create multiple steps to collect information and the wizard control handles the state information for the different steps making all the controls in all the steps easily available.

Thanks, but all the work in the current project I am working on is 1.1. Does anyone know if server.transfer method only work in the Page_Load Sub? It appears that the context items don't become read on the second page if you try to initilize them in another sub proceedure, or anywhere else in the code behind, other than the Page_Load?
 
Back
Top