2 Login pages in web.config = ERROR!



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">


<authentication mode="Forms">

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



<deny users="*" />

<allow roles="Employees" />





<authentication mode="Forms" >

<forms loginUrl="Login.aspx" />



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