I\'m working my ASP.NET MVC 2 project. I create exception filter for catching unauthorized access exception that occur when user does not has permission to view some action.
You can pass through IIS7 default error messages in two ways
One is to set response.TrySkipIisCustomErrors to be true
response.TrySkipIisCustomErrors = true;
response.Status = response.Status;
For some reason, TrySkipIisCustomErrors is not honoured if you don't set response.Status.
The other is to set existingResponse to "PassThrough" in web.config
But this will ignore all set IIS custom error pages.