如何允许匿名用户浏览文件夹的样式 [英] How to allow anonymous user to browse the Style folder
问题描述
在我的web应用程序我想匿名用户浏览只登录页面,而现在是确定的,但它似乎没有风格!
<授权>
<拒绝用户= /&gt的帮助?
<让用户=*/>
< /授权>< /system.web><位置路径=样式>
<&的System.Web GT;
<授权>
<让用户=? />
< /授权>
< /system.web>
< /地点>
任何帮助!
此<一个href=\"http://weblogs.asp.net/gurusarkar/archive/2008/09/29/setting-authorization-rules-for-a-particular-page-or-folder-in-web-config.aspx\"相对=nofollow>文章:
图片和CSS文件
假设你把所有的图像和CSS在一个单独的文件夹,名为图像和你是否认你的网站的匿名访问。在这种情况下,你可能会看到您的登录页面上,你看不到影像(如有)和CSS(如果有的话)应用到您的登录页面控件。
在这种情况下,您可以将web.config文件添加到图像和css文件夹并允许访问每个人都该文件夹。所以,你在图像文件夹的web.config看起来应该如下:
块引用>&LT;结构&gt;
&LT;&的System.Web GT;
&LT;授权&GT;
&LT;让用户=*/&GT; //允许每个人
&LT; /授权&GT;
&LT; /system.web>
&LT; /结构&gt;In my web application I want the anonymous user to browse only the login page, and It's OK now but it appears without style!
<authorization> <deny users="?"/> <allow users="*"/> </authorization> </system.web> <location path="Style"> <system.web> <authorization> <allow users="?" /> </authorization> </system.web> </location>
Any help!
解决方案From this article:
Images and CSS files
Say you have all your images and CSS in a seperate folder called images and you are denying anonymous access to your website. In that case you might see that on your login page you cannot see images(if any) and css(if any) applied to your login page controls.
In that case you can add a web.config to the images and css folder and allow access to everyone to that folder. So your web.config in images folder should look as below:
<configuration> <system.web> <authorization> <allow users="*"/> //Allow everyone </authorization> </system.web> </configuration>
这篇关于如何允许匿名用户浏览文件夹的样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!