0

我有一个包含 3 个应用程序的网站。在网站根目录中,有 3 个文件夹(每个文件夹包含一个 asp.net 应用程序)和一个以index.html3 个链接命名的文件,如下所示:

<a href="Linea1/Pages/Sintesi.aspx"> Linea 1 </a> <br />
<a href="Linea2/Pages/Sintesi.aspx"> Linea 2 </a> <br />
<a href="Linea3/Pages/Sintesi.aspx"> Linea 3 </a> <br />

在每个应用程序的 webconfig 中都有一个 appSettings 值,如下所示:

<add key="linkPaginaHome" value="Index.html" />

在三个应用程序的每个页面中都有一个链接,他的 href 值是从 web.config 中读取的。换句话说,我希望允许您index.html从站点的每个应用程序访问页面,并且此参数必须是可配置的。

我应该在 webconfig 值中写什么以使其指向index.html文件?

4

2 回答 2

0

您可以添加此配置

<configuration>
   <system.webServer>
    <defaultDocument>
        <files>
            <add value="Index.html" />
        </files>
    </defaultDocument>
   </system.webServer>
</configuration>

链接:http ://www.iis.net/configreference/system.webserver/defaultdocument

于 2012-09-25T14:45:29.917 回答
0

我只是使用了完整的网址:

http://localhost:2012/Index.html

而不是只写

Index.html
于 2012-09-27T15:57:18.677 回答