Excluding pages from forms auth - ASP.NET

柔情痞子 提交于 2019-12-23 08:57:10

问题


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>

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.

Is there another option?


回答1:


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

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



来源:https://stackoverflow.com/questions/2178713/excluding-pages-from-forms-auth-asp-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!