ASP.NET Forms Authentication阻止在Login.aspx上加载javascript

我遇到表单身份验证问题.当我尝试加载我的Login.aspx页面时,javascript和样式表都不会加载.
这是我的web.config文件的一部分
<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>

请帮助我,了解发生了什么.

解决方法

您需要在< configuration>下的web.config中为这些目录或文件添加例外.元件.
<configuration>
  <system.web>
     ...
  </system.web>

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

相关文章

### 创建一个gRPC服务项目(grpc服务端)和一个 webapi项目(...
一、SiganlR 使用的协议类型 1.websocket即时通讯协议 2.Ser...
.Net 6 WebApi 项目 在Linux系统上 打包成Docker镜像,发布为...
一、 PD简介PowerDesigner 是一个集所有现代建模技术于一身的...
一、存储过程 存储过程就像数据库中运行的方法(函数) 优点:...
一、Ueditor的下载 1、百度编辑器下载地址:http://ueditor....