473,383 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Passing data between pages using cookies.

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")
Jul 19 '05 #1
1 3697
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)


"Jim Mitchell" <ji**********@mindspring.com> wrote in message
news:#y**************@TK2MSFTNGP11.phx.gbl...
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")

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Paul | last post by:
I want to use sessions to cover myself in case the user switches off cookies so I am passing the session ID manually through a hidden input field. This is what I have so far. index.php page...
1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
6
by: Rob Meade | last post by:
Hi all, At work we have 2 servers in a cluster for our web apps. One problem we have experienced (along with many others!) - is that if a user is logged into one of the applications on server...
3
by: ben | last post by:
Hi guyz, I am developing a website using php.This website involves dealing with forms which span over multiple pages. I want data obtained from 1 form to be available after 3-4 pages. This...
1
by: olduncleamos | last post by:
Hello all. With a background in ASP, I am finding the work required for passing values between pages mystifying. For various obvious reasons, I have eliminated using cookies and session to store...
2
by: Jim Mitchell | last post by:
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...
28
by: Skeets | last post by:
i'm passing session and hidden variables between pages. not to mention post values. i'm a little concerned that someone with sufficient knowledge could spoof these vlaues and manipulate the...
22
by: K. A. | last post by:
I have two servers at work, 'A' for testing and development, and server 'B' for production. On server A, I wrote a PHP test code to login users then direct them to a personalized page. This is...
10
BezerkRogue
by: BezerkRogue | last post by:
I am trying to use cookies to manage session states in an ASP.NET application. The states need to persist only while the browser session is open. My web.config setting is: <system.web>...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.