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

有帮助吗?

解决方案

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"/>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top