Passing data between pages using cookies.

  • Thread starter Thread starter Jim Mitchell
  • Start date Start date
J

Jim Mitchell

I have one ASPX page that calls another using server transfer as shown
below. The problem is that I do not get the cookie in the second page. The
value seems to be blank.

Any help would be appreciated.

Thanks,

Jim

Button_Click Proceedure.......
Dim Cookie As HttpCookie

Cookie = New HttpCookie("SSS")

Cookie.Values.Add("UserCompanyID", txtID.Text)

Response.AppendCookie(Cookie)

Server.Transfer("SLNet_Opportunity.aspx")



In the second page, I have the following code in the page load event.


Dim Cookie As HttpCookie

Cookie = Request.Cookies("SSS")

TextBox3.Text = Cookie.Values("UserCompanyID")
 
as server transfer does not send data to the browser, nor did the browser
post any data back, there are no cookies. you have to get them from the
original page instance, and send back to the browser if you want it to know
about them.


-- bruce (sqlwork.com)
 
Back
Top