![](/img/trans.png)
[英]ASP.NET web.config: What is the default for the debug attribute in system.web.compilation?
[英]Transform Default Document attribute from web config in ASP.NET
如何在 ASP.NET 中轉換 DefaultDocument。 我能夠使用 Key 轉換其他標簽。 但是在我的 Web.config 中,web 配置中不允許使用“Key”屬性。
Web.Config
<defaultDocument>
<files>
<add Key="DefaultDocument" value="Document1.aspx" />
</files>
</defaultDocument>
SecondWeb.config
<system.webServer>
<defaultDocument>
<files>
<add key="DefaultDocument" value="Document2.aspx" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
</files>
</defaultDocument>
</system.webServer>
您只需將 defaultDocument 元素添加到每個配置轉換文件中,如下所示:
<system.webServer> <defaultDocument xdt:Transform="Insert"> <files> <clear/> <add value="Default.aspx"/> <add value="index.html"/> </files> </defaultDocument> </system.webServer>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.