Solved

Urgent Help Needed on Session.get_Item evaluated

Posted on 2004-09-27
1
443 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
1 Comment
 
LVL 1

Accepted Solution

by:
blueforce earned 50 total points
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
External app config and encryption of settings 1 49
Handling arrays 14 33
asp.net bundle 8 32
Converting C# Objects into JSON file 7 35
Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now