Pretty straightforward.
I'm throwing an UnauthorizedAccessException in an AuthorizationFilter. I want UnauthorizedAccessException to head to an Error page, NOT to the /Account/Login page.
How can I make that change?
You can use multiple exception handlers
try
{
// code here
}
catch (UnauthorizedAccessException)
{
Response.Redirect(errorPageUrl, false);
}
catch (Exception)
{
Response.Redirect(loginPageUrl, false);
}