C# 定制错误页面

在web.config的<system.web>下加上以下配置

<customErrors mode="On" defaultRedirect="MyErrorPage.html">
  <error statusCode="403" redirect="NoAccess.htm" />
  <error statusCode="404" redirect="FileNotFound.html" />
</customErrors>

mode:开发时设置成On,发布时设置成RemoteOnly

 

posted @ 2017-06-24 19:33  o李一波o  阅读(401)  评论(0编辑  收藏  举报