【问题标题】:Excluding pages from forms auth - ASP.NET从表单身份验证中排除页面 - ASP.NET
【发布时间】:2010-02-01 17:33:17
【问题描述】:

我知道有两种方法可以从表单身份验证中排除页面。通过使用文件夹中包含需要排除的页面的另一个 web.config 文件或使用 location 元素

<location path="ExcludePage1.aspx">
    <system.web>
        <authorization>
            <allow users="*"/>
        </authorization>
    </system.web>
</location>

我有 20 个页面分散在 Web 应用程序中,因此我无法创建单独的 web.config。但是,由于需要排除的页面数量,我不想为每个页面添加位置部分。

还有其他选择吗?

【问题讨论】:

    标签: asp.net forms-authentication


    【解决方案1】:

    很遗憾,没有。您只能为每个位置元素指定一个路径。

    这主要是由于 .config 文件继承的复杂性(多个可能的 web.configs 和 machine.config)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-11-02
      • 2011-02-26
      • 1970-01-01
      • 1970-01-01
      • 2017-09-28
      • 1970-01-01
      相关资源
      最近更新 更多