Hi Stuart
Thank you for your swift answer. The issue is I would like to dedicate an
seperate login page to each page. I can get it to work if I only use one
login page outside the <location> element.
What works:
<configuration>
<location path="Member" allowOverride="true">
<system.web>
<authorization>
<!-- allow tags must be first -->
<allow users="BØ"/>
<allow users="SB"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
<system.web>
<authentication mode="Forms">
<forms
name="MyWebsiteCookieName"
loginUrl="Login.aspx"
protection="All"
timeout="180"
/>
</authentication>
</system.web>
</configuration>
What doesn't work:
<configuration>
<location path="Member" allowOverride="true">
<system.web>
<authorization>
<!-- allow tags must be first -->
<allow users="Admin"/>
<allow users="User"/>
<deny users="*"/>
</authorization>
<authentication mode="Forms">
<forms
name="MyWebsiteCookieName"
loginUrl="LoginPage1.aspx"
protection="All"
timeout="180"
/>
</authentication>
</system.web>
</location>
</configuration>
As you can see when the authentication is placed within the <location>
element, everything goes nuts :).
Best regards
Simon
"Stuart A Hill" wrote:
Hi Simon,
This error would normally indicate that the Virtual Directory for your web
is not set up properly.
1. Go to Start - Settings - Control Panel - Administrative Tools - Internet
Information Services
2. Expand the nodes to see Default Web Site
Do you have node for your web site? If so check the properties or if you are
not sure about this delete it. If it is not there do the following:
3. Right-click the Default Web Site node to bring up the menu and select
New - Virtual Directory
4. Create a new virtual directory and the location is the folder location of
your files..
Try it again. If this isn't the problem and you still get the same error,
I'll look in more detail at your web.config entries.
Regards,
Stuart
MCSD, MCT
"SB" <SB@discussions.microsoft.com> wrote in message
news:B6**********************************@microsof t.com... Hi
I'm trying to get forms-based authentication to authenticate different
users
for differet pages, like this:
<configuration>
<location path="Member" allowOverride="true">
<system.web>
<authorization>
<!-- allow tags must be first -->
<allow users="Admin"/>
<allow users="User"/>
<deny users="*"/>
</authorization>
<authentication mode="Forms">
<forms
name="MyWebsiteCookieName"
loginUrl="LoginPage1.aspx"
protection="All"
timeout="180"
/>
</authentication>
</system.web>
</location>
<location path="Admin" allowOverride="true">
<system.web>
<authorization>
<!-- allow tags must be first -->
<allow users="Admin"/>
<deny users="*"/>
</authorization>
<authentication mode="Forms">
<forms
name="MyWebsiteCookieName"
loginUrl="LoginPage2.aspx"
protection="All"
timeout="180"
/>
</authentication>
</system.web>
</location>
</configuration>
But here I get this error:
It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level.
Many thanks for your help
Simon