ASP.NET 表单身份验证阻止在 Login.aspx 上加载 javascript [英] ASP.NET Forms Authentication prevents loading javascript on Login.aspx

查看:36
本文介绍了ASP.NET 表单身份验证阻止在 Login.aspx 上加载 javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用表单身份验证时遇到问题.当我尝试加载我的 Login.aspx 页面时,javascript 和样式表都不会加载.这是我的 web.config 文件的一部分

 <身份验证模式="表单"><表单 loginUrl="Login.aspx"超时=30"名称=".ASPXAUTH"路径=/"要求SSL =假"滑动到期=真"defaultUrl="Main.aspx"cookieless="UseDeviceProfile"/></认证><授权><拒绝用户=?"/></授权>

请帮助我了解正在发生的事情.

解决方案

您需要在 web.config 中的 元素下为这些目录或文件添加例外.><预><代码><配置><system.web>...</system.web><location path="css"><system.web><授权><allow users="*"/></授权></system.web></位置></配置>

I am experiencing problems with Forms Authentication. When I try to load my Login.aspx page neither javascript nor stylesheets do not load. Here is part of my web.config file

        <authentication mode="Forms">
        <forms loginUrl="Login.aspx"
               timeout="30"
               name=".ASPXAUTH"
               path="/"
               requireSSL="false"
               slidingExpiration="true"
               defaultUrl="Main.aspx"
               cookieless="UseDeviceProfile" />
    </authentication>

    <authorization>
        <deny users="?" />
    </authorization>

Help me, please, to understand what's happening.

解决方案

You need to add exceptions to those directories or files in your web.config, underneath the <configuration> element.

<configuration>
  <system.web>
     ...
  </system.web>

  <location path="css">
    <system.web>
      <authorization>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>
</configuration>

这篇关于ASP.NET 表单身份验证阻止在 Login.aspx 上加载 javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆