在web.config文件中添加授权时,登录页面样式未显示 [英] Login Page styles are not showing while adding Authorization in web.config file
问题描述
当我在web.config文件中添加授权时,登录页面中未显示表格背景图像,字体等样式.如果我对授权发表评论,那么它正在起作用.
以下是背景图片样式代码
style ="background-image:url(''Images/BgColor.png'')"
以下是身份验证代码.
When i am adding the authorization in web.config file, styles like, table background Image,Font etc are not showing in the Login Page. If i comment the authorization then it is working.
following is the Background Image style code
style="background-image:url(''Images/BgColor.png'')"
Below is the Authentication Code.
<authentication mode="Forms">
<forms loginUrl="Login.aspx"
protection="All"
timeout="30"
name=".ASPXAUTH"
path="/"
requireSSL="false"
defaultUrl="default.aspx"
slidingExpiration="true"
cookieless="UseDeviceProfile"
enableCrossAppRedirects="false" />
</authentication>
<authorization>
<deny users="?" />
</authorization>
推荐答案
您的图像和/或样式表可能在浏览器请求时被拒绝. (因为看起来您的web.config设置为拒绝所有内容)
尝试向web.config中添加与此类似的内容:
Your images and/or stylesheet are probably being denied when the browser requests them. (because it looks like your web.config is set to deny everything)
Try adding something similar to this to your web.config:
<location path="images">
<system.web>
<authorization>
<allow users ="*"/>
</authorization>
</system.web>
</location>
如果我要删除
<deny users="?" />
并添加< allow users ="*"/>它可以正常工作,但是问题是,如果有人在使用其他页面的URL而不进行登录,则不会重定向到登录页面.
and adding <allow users ="*"/> it is working, but the problem is if anybody is using the URL of other pages without loging it won''t redirect to login page.
这篇关于在web.config文件中添加授权时,登录页面样式未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!