Asp.Net应用程序配置Web.config

1.定制出错页面:
     <system.web>
         ......
         <customErrors mode="On" defaultRedirect="ErrorPage.htm" />
         ......
     </system.web>

其中,mode属性表示是否启用定制的用户页面,它可取三个值,如下所示:
On 启用定制的出错页面
Off 禁用定制的出错页面
RemoteOnly 启用定制的出错页面但仅展示给远程用户

defaultRedirect属性表示用户定制出错页面的文件名。

 

2.更改站点导航的默认名字:web.sitmap

 

代码
   
     
< siteMap defaultProvider = " XmlSiteMapProvider " enabled = " true " >
< providers >
< add name = " XmlSiteMapProvider " description = " Default SiteMap provider " type = " System.Web.XmlSiteMapProvider " siteMapFile = " Web.sitemap " securityTrimmingEnabled = " true " />
< add name = " SpecialSiteMapProvider " description = " Special SiteMap provider " type = " System.Web.XmlSiteMapProvider " siteMapFile = " Special.sitemap " securityTrimmingEnabled = " true " />
</ providers >
</ siteMap >

 

 

 

你可能感兴趣的:(asp.net)