我试图遵循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表单例份验证CSS样式不起作用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/28762256/