[英]Web.config changing file default location
我有一个棘手的问题要问你:
在Visual C# IDE
,如何更改文件在单独文件夹中的位置?
所以举个例子
此文件夹的初始路径是VS 2008中的Webproject / folder1 / Default.aspx,我将其转换为2010,并且需要将Default.aspx重命名为folder1Default.aspx才能在2010年正常工作,因为我无法使用多个Default .aspx。 现在,当我尝试导航到该文件夹时,它无法将其作为默认页面打开。 如何将该页面设置为该特定文件夹的默认位置?
如果路径为Webproject / folder1 / folder1Default.aspx,如何使用web.config文件更改此位置?
谢谢。
您这样做了,但是在IIS或配置文件中应该只定义了1个默认文件或索引文件。
<location path="folder1">
<system.webServer>
<defaultDocument enabled="true">
<files>
<add value="folder1Default.aspx"/>
</files>
</defaultDocument>
</system.webServer>
</location>
我已经在配置文件中这样做了
<system.webServer>
<defaultDocument>
<files>
<remove value="default.aspx" />
<remove value="iisstart.htm" />
<remove value="index.html" />
<remove value="index.htm" />
<remove value="Default.asp" />
<remove value="Default.htm" />
<add value="folder1Default.aspx" />
</files>
</defaultDocument>
</system.webServer>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.