Reputation: 23615
i've created a general exception handler in de the global_asax
.
In there i log the exception, and redirect to /error
In that controller, i show the view with a friendly message, and i also set the Response.StatusCode = 500
;
And now i'm wondering if that is ok....
In my localhost cassini
this works fine, but when deployed on IIS
i get the standard IIS 500 page
and not my custom friendly view.
Is that by design?
Upvotes: 0
Views: 54
Reputation: 14418
Try setting the TrySkipIisCustomErrors property in your error handler:
Response.TrySkipIisCustomErrors = true;
It will prevent IIS error pages from getting in the way. Also, make sure you've correctly configured customErrors in Web.config
Upvotes: 1