Passing data between pages using cookies.

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")
 
B

bruce barker

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Passing data via cookies from ASP to ASPX page. 1
Cookies during error handling 1
cookies question 2
Cookie Question 1
httpCookie is null 4
Cookies 1
Cookies 1
sharing cookies between asp and asp.net 3

Top