Search code examples
asp.net-mvchandleerrorasp.net-mvc-beta1

MVC Beta [HandleError] Attribute (need help)


I've tried this both with and without the 'ExceptionType' parameter. I have an Error.aspx page in both the Views/Shared folder and the Views/thisController folder. But everytime I run this I get a "Server Error in '/' Application." error page, rather than the nice one in Views/Shared.

Any idea what could be going wrong here?

[HandleError(View="Error",ExceptionType=typeof(FormatException))]

    public ActionResult Create()
    {
        throw new Exception();
        //int breakMe = int.Parse("not a number");
        return View();
    }

Solution

  • I do indeed have this in my web.config

    <customErrors mode="On"></customErrors>
    

    Must be something else at play.