I am trying to get an ASP.Net MVC2 app to display a simple custom error rather than the yellow screen. I have already set up elmah to silently log the error in the background but while that happens I want to display a simple static error message based on the view in Shared/Error.aspx. Nothing fancy, just a plain vanilla “there was an error”.
<customErrors mode="On" defaultRedirect="~/Error.aspx" />
I thought this was simply a matter of adding a customError tag to my config but I am still seeing the yellow page. Do I have to write a custom action handler for the Error.aspx view before I can use it? Could this be due to some interaction with elmah?
Thanks!
Duffy
Update: It seems that the problem is NInject getting in the way of handling a static error page. The yellow sceen error I am seeing is not for the original error message but the NInject Factory not finding a controller for error.aspx.
I still have no idea why failed to find my static error files. However, I finally got around the problem by defining an error controller and changing my web.config to this instead.