现在的位置: 首页 > 综合 > 正文

网站报错时,自动跳转到指定报错页(error.html)的办法

2012年01月31日 ⁄ 综合 ⁄ 共 173字 ⁄ 字号 评论关闭
在web层的web.config下进行如下配置:
当web层中的页面报错时,会自动跳转到根目录下的error.htm页面,提示用户,非常人性化。

<system.web>
    
    <customErrors mode="On" defaultRedirect="~/error.htm"></customErrors>
</system.web>

抱歉!评论已关闭.