473,387 Members | 1,722 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 Error

There is a part of code which checks whether the session variable is NULL. If
it is then it redirects to login page, but if it is not then it continues
further processing. I have noticed a peculiar behaviour of this variable. At
one instance it passes the NOT NULL code, but then later on in the code it
says that the object reference not set to an instance of an object.
Can anyone tell me why this wierd behaviour?
Jan 29 '06 #1
2 975
Check for null as well as ""
--
If u have the hammer every problem will look like a nail.
"Sinu" wrote:
There is a part of code which checks whether the session variable is NULL. If
it is then it redirects to login page, but if it is not then it continues
further processing. I have noticed a peculiar behaviour of this variable. At
one instance it passes the NOT NULL code, but then later on in the code it
says that the object reference not set to an instance of an object.
Can anyone tell me why this wierd behaviour?

Jan 30 '06 #2
Ankit,
I am sorry to tell you that even that doesnt work. I have tried many
different techniques to resolve it. I also checked against Session counts.
But all in vain. I think this is a generic .NET bug with sessions. Also, you
will find it amaing that all this check is in the left.ascx which loads
before any other code and infact only then the centre screen SHOULD appear.
Thanks anyways.
--
Shrinivas Reddy.
Systems Analyst
Satyam Computer Services Ltd.
"Ankit" wrote:
Check for null as well as ""
--
If u have the hammer every problem will look like a nail.
"Sinu" wrote:
There is a part of code which checks whether the session variable is NULL. If
it is then it redirects to login page, but if it is not then it continues
further processing. I have noticed a peculiar behaviour of this variable. At
one instance it passes the NOT NULL code, but then later on in the code it
says that the object reference not set to an instance of an object.
Can anyone tell me why this wierd behaviour?

Jan 30 '06 #3

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

Similar topics

7
by: Ottar | last post by:
I've made a program sorting incomming mail in public folder. The function runs every minute by using the form.timer event. In Access XP it runs for weeks, no problem. Access 2003 runs the same...
9
by: Greg Linwood | last post by:
I'm having difficulty understanding Session state in ASP.Net. It's almost embarrassing asking this as I've been using ASP since it was first released & it really shouldn't be this hard to use -...
7
by: Spencer H. Prue | last post by:
Hello!, I have a using system.web.sessionstate directive one the top of each of two web pages. On the first page I have the dataadapter, dataconnection, and dataset (also in the component tray)....
2
by: Gavin Lyons via .NET 247 | last post by:
Hello, I'm writing a newsletter application which uses backgroundthreading. I'm using Session variable to report on progresswhile it loops through a dataset. The 'Status.aspx' pagerefreshes every...
2
by: Dave | last post by:
I have an application running on a 3 server webfarm running Windows 2003 with SQLServer Session state. After running for several hours, I started getting the following error. When I access each...
11
by: Jerry | last post by:
I'm using this code: Dim strName For Each strName in Session.Contents Response.Write strName & " - " & Session.Contents(strName) & "<BR>" Next If I only do a response.write strName, it shows...
5
by: lyealain | last post by:
<% If Session("username") = "" Then Response.Redirect("/CLS/Login.asp") End If Dim conn Dim connectstr Dim db_name, db_username, db_userpassword Dim db_server Dim res
7
by: David Lozzi | last post by:
Howdy, I'm trying to capture the session end event. I put a spot of code in the Session_End event in the Global.asax.vb file. The function simply writes to a database table logging the event. I...
6
by: ChrisAtWokingham | last post by:
I have been struggling with unexpected error messages on an ASP.NET system, using SQL and C#. The application draws organisation charts, based on data stored in the SQL database. Some of the chart...
4
by: Cirene | last post by:
In my web.config I added <pages enableSessionState="true">. In each of my pages I also added EnableSessionState="True" to the Page declaration. (I didn't think this was necessary, but...) ...
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
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
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.