Hi everyone,
The 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.
what I'm doing:
I need to enable forms authentication for only one of my pages.
so I made an application under my project using IIS and enabled its forms Authentication. The application contains the page that requires user to log in and a web.config. Below is the code of web.config under the application.
<?xml version="1.0"?>
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<authentication mode="Forms">
<forms loginUrl="login.aspx" protection="All" timeout="60" />
</authentication>
<machineKey validationKey="AutoGenerate" decryptionKey="AutoGenerate" validation="SHA1" />
<authorization>
<deny users="?" />
</authorization>
</system.web>
</configuration>
I can't move these codes to the main web.config of the project since in that case all the pages will require log-in.
I will be grateful of any help.