1
<?
xml version
=
"
1.0
"
encoding
=
"
UTF-8
"
?>
2
<
configuration
>
3
4
<
system.web
>
5
![dot.gif](https://www.cnblogs.com/Images/dot.gif)
![dot.gif](https://www.cnblogs.com/Images/dot.gif)
6
<
customErrors mode
=
"
On
"
defaultRedirect
=
"
ErrorPage.htm
"
/>
7
![dot.gif](https://www.cnblogs.com/Images/dot.gif)
![dot.gif](https://www.cnblogs.com/Images/dot.gif)
8
</
system.web
>
9
10
</
configuration
>
![None.gif](/Images/OutliningIndicators/None.gif)
2
![None.gif](/Images/OutliningIndicators/None.gif)
3
![None.gif](/Images/OutliningIndicators/None.gif)
4
![None.gif](/Images/OutliningIndicators/None.gif)
5
![None.gif](/Images/OutliningIndicators/None.gif)
![dot.gif](https://www.cnblogs.com/Images/dot.gif)
![dot.gif](https://www.cnblogs.com/Images/dot.gif)
6
![None.gif](/Images/OutliningIndicators/None.gif)
7
![None.gif](/Images/OutliningIndicators/None.gif)
![dot.gif](https://www.cnblogs.com/Images/dot.gif)
![dot.gif](https://www.cnblogs.com/Images/dot.gif)
8
![None.gif](/Images/OutliningIndicators/None.gif)
9
![None.gif](/Images/OutliningIndicators/None.gif)
10
![None.gif](/Images/OutliningIndicators/None.gif)
上面的配置信息明确指定了当应用程序出错的时候显示用户定制的页面ErrorPage.htm。并且因为各个应用程序有自己独立的web.config配置文件,所以应用程序之间不会互相干扰。
其中,mode属性表示是否启用定制的用户页面,它可取三个值,如下所示:
On 启用定制的出错页面
Off 禁用定制的出错页面
RemoteOnly 启用定制的出错页面但仅展示给远程用户
defaultRedirect属性表示用户定制出错页面的文件名。