Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

Wanna-Be C# Superstar
  • *Gurus*
Posted
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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...