Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with the Session object and Global.asax

Status
Not open for further replies.

afroblanca

Programmer
Jul 15, 2005
67
US
Can I refer to the Session object inside the Application_Exception handler of my Global.asax?

I want to put some code that looks like this into my Global.asax :

void Application_Error(object sender, EventArgs e)
{
Session["appException"] = Server.GetLastError().GetBaseException();
Response.Redirect("FriendlyErrorPage.aspx");
}

Will this code work? I know that sometimes there are problems with accessing the Session object from Global.asax, but I don't know if I'll run into those inside Application_Error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top