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