【发布时间】:2014-06-08 18:13:31
【问题描述】:
我正在尝试为我网站中的页面 (Master.aspx) 设置不同的身份验证和授权。我尝试使用位置标签,但出现错误。
我的 Web.Config 文件中有这段代码:
<configuration>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.5"/>
<httpRuntime targetFramework="4.5" executionTimeout="360"/>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
<location path ="Master.aspx">
<system.web>
<authentication mode="Forms">
<forms name ="MasterCookie" timeout="30" loginUrl="Register.aspx" />
</authentication>
<authorization>
<deny users="?"/>
<allow users="admin"/>
</authorization>
</system.web>
</location>
</configuration>
我在 17 时遇到了错误:
Line 15: <location path ="Master.aspx">
Line 16: <system.web>
Line 17: <authentication mode="Forms">
Line 18: <forms name ="MasterCookie" timeout="30" loginUrl="Register.aspx" />
Line 19: </authentication>
【问题讨论】:
标签: asp.net vb.net authentication authorization forms-authentication