2014-04-17 154 views
0

请在附件中找到我在尝试显示自定义错误消息时遇到的错误。我的应用程序ASP.Net 4并使用IIS 7.5。 HEre是我在web.config中的代码。自定义消息的IIS错误

</httpErrors> 

enter image description here

回答

0

你应该有这个下的System.Web

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

这(的为数不多的选择之一)

<system.webServer> 
    <httpErrors existingResponse="PassThrough"/> 
+0

现在我得到了服务器错误 '/'应用程序中的服务器错误。 运行时错误 描述:处理您的请求时发生异常。此外,执行第一个异常的自定义错误页面时发生另一个异常。该请求已被终止。 – bp581

+0

设置customErrors mode =“RemoteOnly”,以便获得更多细节。 TXS。 – smoore4

+0

我做到了,但没有帮助。我想要完成的是在应用程序发生意外错误时重定向用户。谁能告诉我如何做到这一点?.Thx – bp581