CSS在登录页面上不起作用 [英] Css doesn't work on login page

查看:61
本文介绍了CSS在登录页面上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我在web.config中使用了以下代码.

hi everybody
I used code below in web.config.

<authentication mode="Forms">
        <forms loginUrl="Login.aspx" />
    </authentication>
 <authorization>
     <deny users="?"/>
 </authorization>



当我登录时,不会显示页面样式,但是当我登录时,默认页面样式可以正常工作.
当我按返回键时,登录页面也可以正常工作.
我该怎么办?
但是,当我删除下面的代码时,一切正常.



When I am on the login page style is not displayed but when I logged in the default page style is working properly.
When I press the back key ,login page also works well.
What should I do?
However, when I remove the code below everything works well.

<authorization>
        <deny users="?"/>
    </authorization




最好的问候




best regards

推荐答案

即使没有经过身份验证的用户,也需要允许CSS文件使用.
在Web.Config中使用以下xml:
You need allow your CSS file to work even with un-authenticated users.
Use below xml in Web.Config:
<location path="myCSS.css">
<system.web>
<authorization>
    <allow users ="*" />
</authorization>
</system.web>
</location>


这篇关于CSS在登录页面上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆