【问题标题】:Location tag error in web.configweb.config 中的位置标记错误
【发布时间】: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


    【解决方案1】:

    我发现在location标签中,不应该有任何身份验证

    【讨论】:

      猜你喜欢
      • 2013-02-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-21
      • 2020-06-10
      • 1970-01-01
      相关资源
      最近更新 更多