【发布时间】:2012-03-14 13:23:49
【问题描述】:
我在我的 asp.net 网站上保护了一个目录(使用 web.config 中的位置拒绝属性)。
当我尝试调用此目录中的 aspx 页面时,它工作正常(拒绝)。但是如果我尝试调用静态文件(例如:logo.gif),我会得到这个异常“会话状态只能在 enableSessionState 设置为真时使用”。
我不明白 gif 文件和目录保护之间的关系。
有没有人已经解决了这个问题?
更新:我正在使用 cms 系统 (DotNetNuke)。 cms 附带一个 URL 重写模块 (iFinity URL Master)。
<!-- Forms or Windows authentication -->
<authentication mode="Forms">
<forms name=".DOTNETNUKE" protection="All" timeout="60" cookieless="UseCookies" />
</authentication>
<!-- ... -->
<location path="Install">
<system.web>
<authorization>
<deny users="*" />
</authorization>
</system.web>
</location>
谢谢。
【问题讨论】:
-
发布更多代码。我不能得到这个错误。你使用什么样的身份验证?您使用什么版本的 .net?
-
我已经编辑了我的问题,希望对您有所帮助。我正在使用 .net 4。
标签: asp.net exception location dotnetnuke session-state