我正在尝试为我的网站中的页面(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>
我发现在位置标签中不应进行任何身份验证
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句