ASP.NET Forms Authentication prevents loading javascript on Login.aspx(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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:ASP.NET 表单身份验证阻止在 Login.aspx 上加载 java
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- 输入按键事件处理程序 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
