How can I get ASP.NET MVC to complete my user settings?

In the customErrors tag in my web.config, I point to the controller. In my controller, I am redirected to an external error page that is used by several applications.

<customErrors defaultRedirect="~/Error/ServerError" mode="On">

My controller:

public class ErrorController : Controller
{

    public ActionResult ServerError()
    {
        return Redirect("/Systems/ASPNETErrorHandling/ErrorPage.aspx");
    }

    public ActionResult ErrorTest()
    {
        throw new Exception("testing error handling");
    }
}

I call Error / ErrorTest to check for error handling. But it always redirects to Views / Shared / Error.cshtml instead of redirecting to the controller I specified.

How to get asp.net mvc to honor the default redirect path in customErrors settings?

UDPATE: ELMAH HandleErrorAttribute, . .Net Reflector, HandleErrorAttribute Error . , Error.cshtml .

+5
1

, HandleErrorAttribute, , ELMAH. Error . base.OnException(context);, . , , , .

+2

All Articles