2 Login pages in web.config = ERROR!

R

rh

In my web.config file, I added code so that users will be redirected to 1 of
2 Login pages depending on the original page they are trying to access.
However, I get the following error message:

Error 106 C:\Source\MyWebSite\Current\Employees\Main.aspx: ASP.NET runtime
error: It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This error
can be caused by a virtual directory not being configured as an application
in IIS. (C:\Source\MyWebSite\Current\web.config line 48)
C:\Source\MyWebSite\Current\Employees\Main.aspx 1 1 C:\...\Current\


Below is the part of my web.config file in question. The error does NOT
occur if I comment out the <authentication> element that is located within
the <location> element (but then I don't get the effect I want).

<location path="~/Employees">

<system.web>


<authentication mode="Forms">

<forms loginUrl="~/Employees/Login.aspx"></forms>

</authentication>


<authorization>

<deny users="*" />

<allow roles="Employees" />

</authorization>

</system.web>

</location>


<system.web>

<authentication mode="Forms" >

<forms loginUrl="Login.aspx" />

</authentication>

<system.web>
 
C

Christopher Reed

This subweb must be defined as an application in IIS before it can use the
web.config file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top