您的位置:首页 > Web前端 > CSS

VS2005使用Forms驗證後,如果用戶還未登陸,也就是未通過驗證,就沒有權限使用工程下面的其他文件,如CSS以及圖片等,解決辦法如下:

2007-09-15 12:52 525 查看
VS2005使用Forms驗證後,如果用戶還未登陸,也就是未通過驗證,就沒有權限使用工程下面的其他文件,如CSS以及圖片等,解決辦法如下:
修改Web.config:
<configuration>
 <appSettings>
 </appSettings>
 <connectionStrings/>
 <system.web>
   <authentication mode="Forms">
   <forms loginUrl="Login.aspx" name=".Performance" timeout="60" path="/">
   </forms>
  </authentication>
  <authorization>
   <deny users="?"/>
   <allow users="*"/>
  </authorization>
 </system.web>
 <location path="CSS/StyleSheet.css">
  <system.web>   
   <authorization>
    <allow users="*"/>
   </authorization>  
  </system.web>
 </location>
 
</configuration>
用<location></location>包含需要有權訪問的目錄或者文件.使用<allow users="*">授權. 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐