Question

Please find attached the error I am getting while trying to display a custom error message. My application ASP.Net 4 and uses IIS 7.5. HEre is my code in web.config.

</httpErrors>

enter image description here

Was it helpful?

Solution

You should have your this under system.web

<system.web>
    <customErrors mode="On" redirectMode="ResponseRewrite" defaultRedirect="~/ErrorPages/WebError.aspx"/>

And this under system.webServer (one of a few options)

<system.webServer>
    <httpErrors existingResponse="PassThrough"/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top