In my web.config I have included:
<customErrors mode="On" />
Now the yellow screen of death isn't shown anymore. I thought I'd have to include the HandleError attribute to my controller methods or the class itself:
[HandleError]
public ActionResult About()
{
throw new Exception("Just an exception");
return View();
}
But it doesn't have any effect, it's the same as:
public ActionResult About()
{
throw new Exception("Just an exception");
return View();
}
In both cases the custom error page is shown. So what is it about the HandleError attribute?
See the following article by Scott Gu. It has all the information about the HandleError attribute http://weblogs.asp.net/scottgu/archive/2008/07/14/asp-net-mvc-preview-4-release-part-1.aspx