Problem displaying custom error page in ASP.NET MVC 2

Posted by robert_d on Stack Overflow See other posts from Stack Overflow or by robert_d
Published on 2010-05-07T21:08:48Z Indexed on 2010/05/07 21:18 UTC
Read the original article Hit count: 1804

Filed under:
|
|

This is customErrors section from my web.config file

<customErrors mode="On">
  <error statusCode="500" redirect="HTTP500.aspx" />
</customErrors>

HTTP500.aspx is the same as standard /Views/Shared/Error.aspx page.

When I get HTTP 500 error I see this page:

Server Error in '/' Application.

Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed.

Details: To enable the details of this specific error message to be viewable on the local server machine, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "RemoteOnly". To enable the details to be viewable on remote machines, please set "mode" to "Off".

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's configuration tag to point to a custom error page URL.


But when I change the above customErrors section like this:

<customErrors mode="On">
  <error statusCode="500" redirect="HTTP500.htm" />
</customErrors>

then HTTP500.htm page is displayed when HTTP 500 error occurs.

Why HTTP500.aspx page isn't displayed?

© Stack Overflow or respective owner

Related posts about asp.net-mvc-2

Related posts about error