473,387 Members | 1,520 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,387 software developers and data experts.

Session variable being cleared--why?

When I visit a specific web page, Request.aspx, for some reason my session
variables are cleared.

I noticed that there is a "EnableSessionState" property on the document
object that has three allowed states "True", "false" and "Readonly". I
would assume that by default, if not specified, it is "true".

however, I decided to explicitly set it to true to see if it helps.

i set it to true in the WebForm. no luck.. Then i realized that it used a
Master Page, so I tried to set the same property there to true.

I get the following error message:

Error 3 Error parsing attribute 'enablesessionstate': Type
'System.Web.UI.MasterPage' does not have a public property named
'enablesessionstate'.
C:\MyDocs\vss\SMIT\SMIT.PackTrack\PackTrack.NET\BI MasterPage.master 1
Any idea why I can't set this property or how to prevent the Session
Variable from being cleared. I access the web page using a relative Url, do
not explicitly clear the variable, am not using frames, am using only 1 IE
Window.

Can anyone suggest a reason why this is happending?

Also, on a separate thought...Is there any easy way to log response times
(Page Post times) in a centralized way such as the ASAX file. I assume there
is something in TRACING, but I dont know much about. A little direction
point would be helpful.

Thanks!

Jun 6 '07 #1
1 3835
I found the issue:

I did something like this is the top of my aspx code behind class:

Private UserId As String = Session("UserId")

I change it to

Private UserId As String

and in the form load add:

UserId = Session("UserId")

Apparently, variables are initialized before the session object is
avaialable for use.
"Chad" <ch**************@unisys.comwrote in message
news:f4**********@trsvr.tr.unisys.com...
When I visit a specific web page, Request.aspx, for some reason my session
variables are cleared.

I noticed that there is a "EnableSessionState" property on the document
object that has three allowed states "True", "false" and "Readonly". I
would assume that by default, if not specified, it is "true".

however, I decided to explicitly set it to true to see if it helps.

i set it to true in the WebForm. no luck.. Then i realized that it used a
Master Page, so I tried to set the same property there to true.

I get the following error message:

Error 3 Error parsing attribute 'enablesessionstate': Type
'System.Web.UI.MasterPage' does not have a public property named
'enablesessionstate'.
C:\MyDocs\vss\SMIT\SMIT.PackTrack\PackTrack.NET\BI MasterPage.master 1
Any idea why I can't set this property or how to prevent the Session
Variable from being cleared. I access the web page using a relative Url,
do not explicitly clear the variable, am not using frames, am using only 1
IE Window.

Can anyone suggest a reason why this is happending?

Also, on a separate thought...Is there any easy way to log response times
(Page Post times) in a centralized way such as the ASAX file. I assume
there is something in TRACING, but I dont know much about. A little
direction point would be helpful.

Thanks!

Jun 8 '07 #2

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

Similar topics

11
by: doltharz | last post by:
Please Help me i'm doing something i though was to be REALLY EASY but it drives me crazy The complete code is at the end of the email (i mean newsgroup article), i always use Option...
2
by: Eric | last post by:
Hi, I've a problem with trying to retrieve a session variable in an include file. Basically, the main asp creates a session variable: <% Session("var1") = "Hello" %> And then when I click...
4
by: John Kraft | last post by:
Hi all, My question is more of a phylisophical one here, but I am wondering what the difference is (effectively and performance wise) between using a shared variable/static variable and using a...
2
by: Joe Molloy | last post by:
Hi, This isn't a mission critical question but I thought I'dl throw it out there for your feedback as it's a bit curious. I have developed a shopping cart for an application I'm working on...
2
by: Todd | last post by:
Here's one that has been stumping people: I'm writing in ASPX with VB.NET On the login page I set the entered usename text to a session variable....
1
by: Vidyadhar Joshi | last post by:
I have the following scenario in a true load balanced environment (without sticky sessions): There are 2 ASPX pages. I want to pass an object from the first page to the second page. On the...
4
by: Don Miller | last post by:
I am using a Session variable to hold a class object between ASP.NET pages (in VB). In my constructor I check to see if the Session variable exists, and if it doesn't, I create one and populate it...
17
by: Control Freq | last post by:
Hi, Not sure if this is the right NG for this, but, is there a convention for the variable names of a Session variable? I am using .NET 2.0 in C#. I am new to all this .NET stuff, So, any...
8
by: YYZ | last post by:
I'm using asp, not asp.net. I've got some open ended questions that I was really hoping someone in here could answer, or direct me to some resources that will help me answer them on my own. ...
5
by: Twayne | last post by:
Hi, If ever a newbie wants to know how much he has to learn yet, he only has to look here<g>!! ANYway: PHP 5.2.5; XP Pro SP2+, local Apache Server My actual question is: How do I get a...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...

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.