村长

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

虚拟目录继承根目录web.config

 虚拟目录继承根目录web.config 设置很多人有时都会为虚拟目录中的web.config继承了主目录中的web.config而苦恼,
大部分主要是由于根目录中的web.config添加了httphandler、 httpmodule 引起的。
其实这个问题解决起来很简单,只将 httphandler httpmodule的声明添加到location中即可。
如下所示:

<configuration>
<location path="." allowOverride="true" inheritInChildApplications="false">
<system.web>
<httpModules>
<add name="UrlRewriteModule"
type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
</httpModules>
</system.web>
</location>
</configuration>


path 不用说指定的是一个目录
allowOverride 指是否可以将这个重写
inheritInChildApplications 指是否被子级应用程序继承 
本文出自:http://www.cnblogs.com/puream/archive/2009/07/16/1524888.html
posted on 2011-05-21 23:41  Say No  阅读(183)  评论(0编辑  收藏  举报