2010-04-13 83 views
2

如何「清除」在我的子應用程序的web.config中定義<controls>供應商?子web.config無法清除<pages><controls>從父web.config

父Web配置。

<system.web> 
    <pages> 
     <controls> 
      <!-- START: Vendor Custom Control --> 
      <add tagPrefix="asp" namespace="VENDOR.Web.UI.Base" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral /> 
      ... 
      <!-- END: Vendor Custom Control --> 
      ... 
      </controls> 
     <tagMapping> 
     <add tagType="System.Web.UI.WebControls.WebParts.WebPartManager" mappedTagType="Microsoft.Web.Preview.UI.Controls.WebParts.WebPartManager" /> 
     <add tagType="System.Web.UI.WebControls.WebParts.WebPartZone" mappedTagType="Microsoft.Web.Preview.UI.Controls.WebParts.WebPartZone" /> 
     </tagMapping> 
    </pages> 
</system.web> 

兒童:

<system.web> 
    <pages> 
     <controls> 
      <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
     </controls> 
     <tagMapping> 
      <clear/> 
     </tagMapping> 
    </pages> 
</system.web> 

我有工作了<tagMapping>部分,但<controls>不支持<clear/>

回答

0

在頂部

+0

''也不支持。錯誤: 元素'controls'具有無效的子元素'remove'。預期的可能元素列表:'add'。 – 2010-04-13 22:28:23

2

嘗試<remove/>每個的TagPrefix,可能與一個<clear/>結合有的stopping web.config inheritence一點已知的方式。在你的情況下,你會圍繞<system.web>...</system.web>元素附加一個<location inheritInChildApplications="false">...</location>。當然,這將刪除該部分中所有內容的繼承,但如果這是您正在尋找的內容,它將解決您的繼承問題。

+0

我正在嘗試將自定義功能添加到供應商的應用程序。我不想修改父級web.config。我可能需要解決並將供應商的DLL引入我的項目中。 – 2010-04-13 22:57:26