ASP.NET窗体身份验证prevents上的Login.aspx加载JavaScript [英] ASP.NET Forms Authentication prevents loading javascript on Login.aspx

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

问题描述

我遇到了窗体身份验证的问题。当我尝试加载我的Login.aspx页面的JavaScript都不样式也不会加载。
这里是我的web.config文件的一部分

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.

推荐答案

您需要添加例外的目录或文件在你的web.config,下方的&lt;结构&GT; 元素。

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窗体身份验证prevents上的Login.aspx加载JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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