custom error pages

VBAHole22

Contributor
Joined
Oct 21, 2003
Messages
432
Location
VA
I am trying to create custom error pages to handle Page Not found errors more gracefully.

I have modified my web.config file as such:

<customErrors mode="On" defaultRedirect="AppError.aspx">
<error statusCode="404" redirect="NotFound.aspx" />
</customErrors>

And I built the two pages that are referred to but I still get that stale 404 page, not my custom page. What am I doing wrong? Do I need to make a change in global.asax also?
 
Oddly enough I can now trap all errors on the page and have it redirect to my custom page EXCEPT 404 page not found errors.
 
Make sure that "NotFound.aspx" actually exists in the current directory. If it does not the runtime will fallback to the default "file not found" error page. Also keep in mind that you will need to prefix the error page's location with a "/" if the application contains subdirectories.
 
Back
Top