473,513 Members | 7,598 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

session variables not updating

I have an aspx page that I want to use to collect info and create session
variables before navigating to another aspx page to use the new session vars.
Ie, consider the following page, setSession.aspx ...
<%
Dim dlrCode = Request.QueryString("dlrCode")
Dim fileName = Request.QueryString("flName")

session("snDealerCode") = dlrCode
Response.Redirect("" & fileName & "")
%>

If I navigate to this page with
http://localhost/myApp/setSession.as...ame=Page2.aspx I
correctly navigate to Page2.aspx and I see "hello 3000" printed (with the
help of a Response.Write("hello " & Session("snDealerCode") statement in
Page2.aspx)

The problem is that if I then navigate to
http://localhost/myApp/setSession.as...ame=Page2.aspx,
Page2.aspx comes up and still displays "hello 3000". If I click Refresh,
Page2 then updates and correctly displays "hello 8888". I really don't want
users to have to click Refresh every time.

Does anyone have any ideas what I'm doing wrong?
TIA
Mar 9 '06 #1
1 1651
I think the problem is that when redirecting which means the session cookie
isn't being writen out. Yuo can take a look at :
http://weblogs.asp.net/bleroy/archiv...03/207486.aspx

for more details..but in the end, the solution tends to be to do a
Response.Redirect("path.aspx", false);

karl

--
http://www.openmymind.net/

"Scott F K Hooper" <Sc***********@discussions.microsoft.com> wrote in
message news:FD**********************************@microsof t.com...
I have an aspx page that I want to use to collect info and create session
variables before navigating to another aspx page to use the new session
vars.
Ie, consider the following page, setSession.aspx ...
<%
Dim dlrCode = Request.QueryString("dlrCode")
Dim fileName = Request.QueryString("flName")

session("snDealerCode") = dlrCode
Response.Redirect("" & fileName & "")
%>

If I navigate to this page with
http://localhost/myApp/setSession.as...ame=Page2.aspx I
correctly navigate to Page2.aspx and I see "hello 3000" printed (with the
help of a Response.Write("hello " & Session("snDealerCode") statement in
Page2.aspx)

The problem is that if I then navigate to
http://localhost/myApp/setSession.as...ame=Page2.aspx,
Page2.aspx comes up and still displays "hello 3000". If I click Refresh,
Page2 then updates and correctly displays "hello 8888". I really don't
want
users to have to click Refresh every time.

Does anyone have any ideas what I'm doing wrong?
TIA

Mar 9 '06 #2

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

Similar topics

14
8840
by: RooLoo | last post by:
Hey all In my GLOBAL.ASA file I'm trying to create a session variable for reference in the various webpages of my site.... Sub Session_OnStart Session("LoggedOn")="Y" End Sub When...
10
1689
by: Michael SL | last post by:
I have been using session variables in my asp.net application without any trouble. But now in a very specific case I am losing them. On one of my pages I set a date in a dropdownlist...
2
7813
by: stewartfip | last post by:
My global.asax file looks something like this: sub Session_Start() session("sessionID") = end sub sub Application_PreRequestHandlerExecute() if session("sessionID") <> 0 then
13
1733
by: | last post by:
Simple question, I think... I'm storing an object in the Session object. In the code behind I read that object: trx = CType(Session("Transaction"), BOCSTransaction) If I change any...
1
3091
by: Scott F K Hooper | last post by:
I have an aspx page that I want to use to collect info and create session variables before navigating to another aspx page to use the new session vars. Ie, consider the following page,...
3
1136
by: GHawley | last post by:
I have a fairly large application with about 200 users that uses Session variables. It would seem that occasionally these variables are being referenced incorrectly to the extent that different...
6
18213
by: somaskarthic | last post by:
Hi This is somas here. I asked query about detecting the browser close event using javascript. I want to detect the event only when the X button in the top right corner is clicked and not else...
6
5122
by: =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post by:
Greetings! I was researching AJAX to provide a solution to displaying status messages while a long process executed. I found several examples online and was able to use their code to get a quick...
1
8573
by: Brennan Mann | last post by:
Hello, I am having problems updating PHP session variables. I can set them and see them using the following debug print_r($_SESSION); Once, I start using smarty templates, I cannot modify the PHP...
0
7254
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7094
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7519
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1585
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.