Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Urgent Help Needed on Session.get_Item evaluated

Posted on 2004-09-27
1
Medium Priority
?
464 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 200 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

730 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