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

Session is lost during error handling

Hi,

I have an ASP.NET page that generates an Exception...
The Exception is not caught in the executing method...so it propagates
to..the Page_Error event handling method..
In that method the Exception is handled by the client exception
policy...basically it logs the information coming from the business layer...
We then create a custom message object that contains user/context specific
information and adds that to the Session object..
Since I don´t call Server.ClearError() the Exception propagates
further...and is handled by the applications Error page...

In the Error page I would like to retrive the custom error object from the
Session but the object is not there...
Only if I make a specific Response.Redirect() can I retrive the
session...i.e. not using ASP.NETs error handling/propagating.

Why am I losing this information? What is going on inside ASP.NET with the
session during error handling?

Regards
/Oscar
Nov 19 '05 #1
1 2293
Hello,

from here:

http://forums.asp.net/7504/ShowPost.aspx

Q: Will my session state be saved when my page hit an error?
A: If you're using StateServer or SQLServer mode, for data integrity reason
session state module will not save any changes to session state if there is
an error. To work around this, you can call Server.ClearError in your
exception handler.
For InProc mode, changes are made directly to the in-memory objects and so
whatever changes you've made so far will stay in the memory. However, if
it's a new session, ASP.NET will not insert your session state into the
internal table, and thus your session state will NOT be saved, unless you
call Server.ClearError in your exception handler.
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

Nov 19 '05 #2

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

Similar topics

3
by: Richard P | last post by:
I am experiencing some browser weirdness. My app uses session state to hide values I prefer to keep out of the querystring. I am testing to see what happens when cookies are fully disabled in IE...
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 -...
4
by: danman226 | last post by:
I will be using a companyname, user name, and password to authenicate users in my system. I am trying to save the company name in the session for later use. I cannot access the Session object in...
10
by: tshad | last post by:
I have been using the default session state (InProc) and have found that I have been loosing my information after a period of time (normally 20 minutes). Is there anyway to find out how much...
9
by: McGeeky | last post by:
Is there a way to get a user control to remember its state across pages? I have a standard page layout I use with a header and footer as user controls. Each page uses the same layout by means of...
2
by: Daflookie | last post by:
For one reason or another I am unable to access Session contents in my asp.net application via the global.asax's Application_Error event. I can pull this exact code snippet below out of...
43
by: davidkoree | last post by:
I mean not about cookie. Does it have something to do with operating system or browser plugin? I appreciate any help.
8
by: Andrew Teece | last post by:
Hope someone can help. We are trying to deploy an ASP.Net 2.0 application to a 3-node webfarm. The application uses the ReportViewer control in local mode, hence we need session state. Because we...
14
by: Rick | last post by:
We are in the process of testing a large web project that I converted from VS 2003 to VS 2005. Everything seems to be working except for a few minor things. But the main issue I have is this, I...
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?
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...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.