customerrors

ASP.NET Application hosted on IIS7 that is ignoring custom errors and falls back to IIS errors

I have a C# web forms ASP.NET 4.0 web application that uses Routing for URLs for some reason custom errors defined in the system.web section of my web.config is entirely ignored and it will fall back the IIS errors. This gets entirely ignored <system.web> <customErrors mode="On"> <error statusCode="500" redirect="~/Error" /...

ASP.NET customErrors with mode=remoteOnly and global.asax handling exceptions

I have custom errors set in the web config file as follows: <customErrors mode="RemoteOnly" defaultRedirect="GenericError.aspx" /> Fine and dandy... I like that mode="RemoteOnly" facilitates development... For unhandled exceptions, I have in global.asax: Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs) Respons...

Custom errors override in ASP.NET MVC area

I would like to have custom error pages unique to an MVC area. Unfortunately, it appears that the Web.config override system doesn't take the MVC folder structure into account. If I want to override an area called "mobile", I have to create a root project folder (in with Views and Controllers) named "mobile" and put the Web.config in the...

Why can't i see a detailed error message in this aspx page?

I have a aspx page and it displays custom error but i can't see a detailed error message. My web.config looks like this, <?xml version="1.0"?> <configuration> <appSettings /> <connectionStrings /> <system.web> <compilation debug="true" /> <authentication mode="Windows" /> <customErrors mode="On" /...

Can't find the custom error page

Here's how I have it defined (locally, on my development machine): <customErrors mode="On" defaultRedirect="Error.aspx"> <error statusCode="404" redirect="NotFound.aspx" /> </customErrors> And I have the [HandleError] attribute: [Authorize] [HandleError] public class HomeController : Controller { // etc. Yet when I ...

How to send status code "500" for generic error page in IIS?

I am using a generic error page using ASP.NET's <customErrors> directive. <customErrors mode="On" defaultRedirect="500.html" redirectMode="ResponseRewrite"> </customErrors> Problem - when an error occurs, this page does not return HTTP status "500". It comes as 200. So link checkers and spiders do not see that there is any problem. H...

Is NLog work with customErrors?

when i use <customErrors mode="Off"/> and i have an error on the screen it writes to log file but when i use <customErrors mode="RemoteOnly"/> then i see my custom error page but error not catches but logger :-/ ...

ASP .NET: Thread.CurrentPrincipal is lost when customErrors contains redirectMode="ResponseRewrite"

I setup my custom principal in one of the modules that handles Authentication_Request. Then I set it HttpContext.User. That sets my HttpContext.User and Thread.CurrentPrincipal. Now when an error occurs and customErrors section contains "ResponseRewrite", Thread.CurrentPrincipal is reset to generic principal on my ASPX error page., but m...

Custom 404 error not redirecting properly

I have this custom error redirect in my web.config file but it doesn't seem to be working since i added the redirectMode="ResponseRewrite" It works fine for 500 errors but not for 404 (it just doesn't redirect when i have a 404) Here's the code from web.config <customErrors mode="On" redirectMode="ResponseRewrite"> <error statusC...

HttpRequestValidationException showing YSOD despite customErrors section.

Hi, we've modified our customErrors section to protect against the recent ASP.NET vulnerability. Our problem is, that HttpRequestValidationException's are now causing a YSOD's to be shown, other exceptions and page not found errors are showing our custom error page. If we change the redirectMode to ResponseRedirect everything works fi...

Catching CustomErrors in ASP.NET

I have the following entry in the web.config: <customErrors mode="RemoteOnly" defaultRedirect="Error.aspx" /> Is there a way in Error.aspx.cs to obtain the error details so I can save to a file? ...

How to get Custom Error Pages working for Classic ASP with IIS 7 Integrated Pipeline

I'm working on a website with legacy Classic ASP pages (being converted to ASP.NET on an as needed basis) and new ASP.NET pages. Use of IIS 7 Integrated Pipeline has been very helpful with our configuration. For example, we were able to get forms authentication working auto-magically with the classic ASP pages simply by configuring the a...