我在项目中指定了自定义错误
<customErrors mode="On" defaultRedirect="http://redirect" />
它可以处理500个错误状态,但是当我犯下另一个错误时不起作用
像http://127.0.0.1/home/1一样,可以很好地处理403或404错误。
没用。我的IIS服务器返回到403或404的IIS默认错误页面如何处理此错误?
最佳答案
尝试使用以下格式:
<customErrors mode="On">
<error code="403" path="403.html" />
<error code="404" path="404.html" />
<error code="500" path="500.html" />
</customErrors>
有关更多详细信息,请参见MSDN here。
关于c#-4.0 - ASP.NET 4.0错误处理除500状态外不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37107062/