我正在尝试关注 this example .
我面临的一个问题是,每当我访问 Login.aspx 页面或被重定向到该页面时,我的 CSS 样式都不会显示。只有当我成功登录并且重定向到 default.aspx 时,我的 css 样式才会正确显示。
有什么方法可以让我的 CSS 正常工作?
更新 #1:
我已经设法像这样将它添加到 webconfig 中:
<location path="Styles/style.css">
<system.web>
<compilation debug="true" targetFramework="4.5"/>
<httpRuntime targetFramework="4.5"/>
<authentication mode="Forms">
<forms name=".ASPXUSERDEMO" loginUrl="Login.aspx" protection="None" timeout="60"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
<globalization requestEncoding="UTF-8" responseEncoding="UTF-8"/>
</system.web>
</location>
但一个问题是我的页面不再受表单例份验证保护。我该如何解决?谢谢!
最佳答案
尝试添加带有相关标签的css
:
示例:在html
标签后添加此部分:http://pastebin.com/jxFsG5xc
<style type="text/css">
h3 {
font-family:Verdana;
}
#Msg {
font-family:Verdana;
color:red;
}
</style>
css
教程 - http://www.w3schools.com/css/
关于c# - pdatASP.NET Forms 身份验证 CSS 样式不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28762256/