错误页定义方法

(1)代码逻辑错误:

默认显示/Views/Shared/Error.cshtml

(2)404 500等错误

<system.web>

<customErrors mode="Off" defaultRedirect="/error.htm"/>

</system.web>

其中error.htm放在iis根目录下

(3)项目名称错误

在IIS中配置

错误页代码:

原文地址:https://www.cnblogs.com/lcyuhe/p/5961505.html