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
基础教程推荐
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- WPF 模态进度窗口 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
