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

在web层的web.config下进行如下配置:
当web层中的页面报错时,会自动跳转到根目录下的error.htm页面,提示用户,非常人性化。
<system.web>
    
    <customErrors mode="On" defaultRedirect="~/error.htm"></customErrors>
</system.web>
posted @ 2009-09-10 21:21  王翔(kingfly)  阅读(1096)  评论(0编辑  收藏  举报