2 Login pages in web.config = ERROR!

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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>




.



Relevant Pages

  • Re: Can login domain be set to a default?
    ... need for specifying a login domain. ... accounts of the IIS box (and the login process needs a way to ... cannot specify a default domain for Windows integrated authentication ... > The internal domain for the three servers is different than the web site ...
    (microsoft.public.windows.server.security)
  • Re: Basic Authentication fails with Error 401.2 where Integrated s
    ... The password dialog is supposed to appear for Basic authentication ... Thinking more esoterically now -- what are the login rights assigned ... IIS uses a specific login type, ... account created has full permissions for the folder and the file that's in it. ...
    (microsoft.public.inetserver.iis.security)
  • Re: disabling IIS login prompts
    ... if you using IIS authentication, by design, in local ... intranet zone, IE auto login for user, hence no prompt. ... >> In IIS on your internal web site disable all other authentication methods ...
    (microsoft.public.inetserver.iis.security)
  • Re: disabling IIS login prompts
    ... IIS supports. ... Proper authentication protocols only return "yes or no" as to whether the ... As for the number of prompts -- no, that cannot be changed by the server. ... IIS does not show any login prompts when you enable security. ...
    (microsoft.public.inetserver.iis.security)
  • Re: Logging into website - remove log in box
    ... the issue is NOT about removing the login box. ... then enable anonymous authentication and disable any other ... authentication in IIS. ... browser auto-login so no login box shows up. ...
    (microsoft.public.inetserver.iis.security)