Exclude pages from auth forms - ASP.NET

I understand that there are two ways to exclude pages from auth forms. Either using another web.config file in the folder with the pages you want to exclude, or using the location element

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

I have 20 pages scattered throughout the web application, so I cannot create a separate web.config. However, due to the number of pages to be excluded, I would prefer not to add a location section for each of these pages.

Is there any other option?

+6
forms-authentication
source share
1 answer

Unfortunately not. You can specify only one path for a location item.

This is mainly due to the difficulty of inheriting the .config file (several possible web.configs and machine.config).

+5
source share

All Articles