从窗体身份验证不计的页面 - ASP.NET [英] Excluding pages from forms auth - ASP.NET

查看:139
本文介绍了从窗体身份验证不计的页面 - ASP.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,不包括窗体身份验证页面的2种方式。或者通过使用具有需要被排除的页的文件夹中或通过使用位置元件另一个web.config文件

I understand there are 2 ways of excluding pages from forms auth. Either by using another web.config file in the folder that has pages that need to be excluded or by using the location element

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

我有20页散落各地的Web应用程序,所以我不能创建一个单独的web.config。然而,由于需要排除的页数,我宁愿不希望添加的位置部分每个页面。

I have 20 pages scattered all around the web app, so I cannot create a separate web.config. However, due to the number of pages that need to be excluded, I would rather not want to add the location section for each of these pages.

难道还有其他选择吗?

推荐答案

可惜没有。只能指定每个位置元素的一个路径。

Unfortunately no. You can only specify one path per location element.

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

This is mainly due to the complexity of .config file inheritance (multiple possible web.configs and machine.config).

这篇关于从窗体身份验证不计的页面 - ASP.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆