Click to See Complete Forum and Search --> : Context.Items.Add & server.transfer problem.


binici
10-13-2006, 06:51 PM
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:

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:

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:

Thank you!

binici
10-18-2006, 11:35 AM
Does server.transfer only work on the Page_Load Sub?

jimisway
03-27-2009, 04:40 PM
Doesnt work in ButtunClick even handling code, because that would mean another Http request(a postback), and the Context Object persists only across one Http Request.