Unhandled Exceptions - ASP.Net

  • Thread starter Thread starter tberry
  • Start date Start date
T

tberry

I have just begun reviewing how to create a custom error page for
unhandled exceptions. I found if I set custom HTML pages in Web.config
those work fine. But referencing .aspx pages in Web.config produced the
standard exception page.

I then used Server.Transfer(name.aspx); in the Application_Error method
in Global.asax.cs. This of course worked. My question is why didn't
Web.config redirect to the aspx page? The code in Web.config is:

<customErrors mode="On" defaultRedirect="GenericError.aspx">
</customErrors>

I am using VS.Net 2003

Thank you
T Berry
 
Did you try

<customErrors mode="On" defaultRedirect="GenericError.aspx" />

I would use that since you don't define specific errors. Also, you
don't have any code in your GenericError.aspx that would throw an
exception do you?

-Darren Kopp
http://blog.secudocs.com/
 
Back
Top