Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiple aspx pages in Location Path
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 4.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01613745
Message ID:
01613802
Views:
38
Each location can only specify one URL. If you need more you need multiple location entries.

There are a few ways you can deal with this:

Put all unauthenticated items into a single folder (maybe the root and all authenticated in subfolders) then use that for the location that's not authenticated.

Another way you can do this is skip the Forms Authentication configuration section and explicitly check for authentication on your pages. It's pretty trivial to write code to check if a user is authenticated and if not redirect them to your login page of choice. You can write a single static method in a helper class that that does that and call it from each request (or even a page base class if most cases require it and then have a flag to not authenticate).

+++ Rick ---

>Hi,
>
>When using Form Authentication you can specify in the web.config that an ASPX page should be allowed for any user without authentication.
>This is a sample code:
>
>
><location path="MyTestPage1.aspx">
>	  <system.web>
>	    <authorization>
>		    <allow users ="*" />
>	    </authorization>
>	    </system.web>
></location>
>
>
>And you can have as many of these Location specified as needed. But I was wondering if it is possible to specify multiple aspx pages in one location. Here is what I tried but it does not work:
>
>
><location path="MyTestPage1.aspx; MyTestPage2.apx; MyTestPage3.aspx">
>	  <system.web>
>	    <authorization>
>		    <allow users ="*" />
>	    </authorization>
>	    </system.web>
></location>
>
>
>Please let me know if it is possible and how. TIA
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform