Global Var

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?
 
U

Uriah Piddle

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top