[2.0?] error management

L

Lloyd Dupont

I try to manage error in my application, I have set customErrors=On in the
web config and redirect them to a custom web (.aspx) page of mine.

unfortunately in case of error, for some reason, when I reach error.aspx
Server.GetLastError() return null.

I decided to use the error event in Global and write
Session["last error"] = Server.GetLastError().

unfortubately, while it works in 1.1, in 2.0 betat I get an exception kind
of view state can't be used in this context.


any workaround, tip, similar experience ?
 
J

Jeffrey Palermo [MCP]

In your ASP.NET base page, write code to handle any error that might happen.
(OnError), and stash the Exception in Page.Items collection. The system
will do a Server.Transfer to your custom error page where you can retrieve
the exception from the Page.Items collection and act on it. Google this
solution, and you'll get many different variations of this method.

Best regards,
Jeffrey Palermo
 

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

Members online

No members online now.

Forum statistics

Threads
473,778
Messages
2,569,605
Members
45,237
Latest member
AvivMNS

Latest Threads

Top