Global Var

  • Thread starter Thread starter Uriah Piddle
  • Start date Start date
U

Uriah Piddle

Hi Gang,

I need to persist error info between the Application_Error block in
Global.asax and the custom error page. I am trying to use the built-in
Application class. I am writing this code in the Application_Error block:

Application["errInfo"] = info;
Server.Transfer("~/Error.aspx")

When I try to access the "errInfo" object in Application, I get nothing.
Here is the code in Error.aspx:

info = (string)Application["errInfo"];

I can use the Application class in other parts of my project but it does not
seem to work when I use it in the Application_Error block. Thanks for any
ideas.

Steve

ps: any other ideas about how to get the info into Error.aspx?
 
More info: the exception that the tests were based on was raised in
Global.asax. I got the idea to try throwing an exception in a page and when
I did, the code worked as designed. So it looks like exceptions originating
in Global.asax cause this kind of issue.
 
Back
Top