使用注册为allowDefinition =' MachineToApplication'的部分是错误的.超出应用程序级别. [英] It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.
问题描述
我遇到的错误是
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:\Users\Jangid\Downloads\TestWebSite1\TestWebSite1\Backup\TestWebSite1\Web.config 26
我已经在使用ASP.Net 2.0的服务器中托管了一个网站,我在根文件夹中有一个web.config,在Admin文件夹中也有一个,但是admin文件夹不是虚拟目录,因此我不想创建
I have hosted a website in a server using ASP.Net 2.0, i have a web.config in the root folder and also one in the Admin folder, but the admin folder is not a virtual directory and i dont want to create.
<authentication mode="Forms">
<forms loginUrl="Admin/Login.aspx" name=".ASPXFORMSAUTH"/>
</authentication>
<authorization>
<allow roles="Admins"/>
<deny users="*"/>
<deny users="?"/>
</authorization>
但是对于Admin文件夹的身份验证和登录工作,我使用了ASP.Net登录控件,但是此错误阻止了我前进.
But for authentication and login work for Admin folder, i have used ASP.Net Login Control, but this error preventing me to move formward.
也请任何人给我一个用于学习ASP.Net登录控件的链接,例如访问Admin文件夹的用户应以Role身份验证为admin,如何在服务器上创建角色并分配给用户
And also please can any one give me a link for learning ASP.Net Login Control, Like user who visit Admin folder should be authenticated with a Role as admin, How can i create a Role and assign to user on a server
推荐答案
<system.web>
<authentication mode="Forms">
<forms name="cokiename"
loginUrl="./protectedFolder/login.aspx"
protection="All"
timeout="60"
defaultUrl="./protectedFolder/protectedPafe.aspx"/>
</authentication>
</system.web>
这应该在您的主要web.config文件中
This should be in your main web.config file
以下内容进入您的子目录配置
Following goes into your sub directory config
<configuration>
<system.web>
<customErrors mode="Off"/>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</configuration>
受保护的文件夹包含登录页面,受保护的页面和web.config
protected folder contains the login page, protected pages and the web.config
这篇关于使用注册为allowDefinition =&#39; MachineToApplication'的部分是错误的.超出应用程序级别.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!