【问题标题】:Link to a file external of the application链接到应用程序外部的文件
【发布时间】:2012-09-25 14:39:32
【问题描述】:

我有一个包含 3 个应用程序的网站。在网站根目录中有 3 个文件夹(每个文件夹包含一个 asp.net 应用程序)和一个名为 index.html 的文件,其中包含 3 个这样的链接:

<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 文件?

【问题讨论】:

    标签: asp.net web-applications iis-7 web web-config


    【解决方案1】:

    你可以添加这个配置

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

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

    【讨论】:

      【解决方案2】:

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

      http://localhost:2012/Index.html
      

      而不是只写

      Index.html
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-08-03
        • 1970-01-01
        • 1970-01-01
        • 2019-09-22
        • 2010-12-09
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多