Solved

Urgent Help Needed on Session.get_Item evaluated

Posted on 2004-09-27
1
454 Views
Last Modified: 2011-10-03
Dear all,

I having a problem here. The situation is as follow, I have a web system with is using C#, if error occur it will capture the error in Global.asax.cs in "Application_Error" and it will kept the error message in a session - Session["ErrorMsg"].

In Global.asax.cs it wil redirect to an error page - "ErrorPage.aspx" to display the error message reading from the session.

The problem is on "Page_Load" in "ErrorPage.aspx", it try to read the Session["ErrorMsg"] but it return error which is :- "function 'Session.get_Item' evaluated and returned null"

What is the problem that cause the error ? Would help if example is provided.

Thanks in advance.


Cheer,
yymae
0
Comment
Question by:yymae
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
blueforce earned 50 total points
ID: 12165748
There could be a lot of causes for this.

The simplest solution to try first:

Immediately after setting the Session["ErrorMsg"] object, you should call Server.ClearError() in order to preserve Session state.

eg.

Session["ErrorMsg"] = Server.GetLastError.InnerException;
Server.ClearError();

Try that first, we can go from there.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Visual Studio hangs on running project 6 85
C# Linq - Join two objects into one 3 55
ASP.NET data base connection 35 95
aspx ascx, c# 7 44
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Suggested Courses

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question