Click to See Complete Forum and Search --> : Unable to display Custom Error page


ZhiYi
June 3rd, 2007, 11:03 PM
I have created a custom error web page which is supposed to be displayed when the user tries to access an invalid page but instead of the custom error page appearing, the standard "Server Error in 'Error handling' application. The resource cannot be found" asp.net error page appeared instead.

I edited the web.config file like this:

<customErrors mode="Off" defaultRedirect="PageNotFound.aspx">
<error statusCode="403" redirect="PageNotFound.aspx"/>
<error statusCode="404" redirect="PageNotFound.aspx"/>

The custom page's name is PageNotFound.aspx.
The default address of the website is: http://localhost:1351/Error%20handling
When I tried to access a non existant web page like:
http://localhost:1351/Error%20handling/lucky.aspx , only the standard error page appeared instead of the custom error page.

How do I make the custom error page appear?

mcmcom
June 4th, 2007, 11:01 AM
you want
<customErrors mode="On" defaultRedirect="PageNotFound.aspx">

with it set to "Off" it uses default error message (what your seeing)
Custom Errors should be On so you can show it your Custom error page.

hth,
mcm