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 .