How can I redirect the user to the user error page when an HttpRequestValidationException occurred. I tried to catch it in my base controller:
protected override void OnException(ExceptionContext exceptionContext)
{
if (exceptionContext.Exception is HttpRequestValidationException)
{
this.View("CustomError").ExecuteResult(this.ControllerContext);
}
}
But I still get an exception: A potentially dangerous request.form value was found at the client
source
share