


























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="*">授權.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。