web config - ASP.Net - How to determine if web request is to a resource that allows anonymous users or not -


i have denied anonymous access entire application using following web.config setting:

<authorization>    <deny users="?" /> </authorization> 

then, various paths, have allowed anonymous access using web.config settings such this:

<location path="home/showlogin"> <system.web>   <authorization>     <allow users="*"/>   </authorization> </system.web> 

i'd able determine during processing of given request whether requested url path allows anonymous users or whether request path denies anonymous users.

what elegant way of determining this?

you can use following code collection of location elements:

configuration config = webconfigurationmanager.openwebconfiguration("~"); foreach (configurationlocation location in config.locations) {   // work location object } 

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -