vs2005下出现“Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive”的解决方法

VS2005下出现“Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive”的解决方法
通常是因为WSS引起~,

1.启用SessionStateModule (加在<system.web></system.web>里)
    <httpModules>
      
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
    
</httpModules>

2.启用SessionState(加在<system.web></system.web>里)
   
3.设置Turst为Full级别(加在<system.web></system.web>里)
   
<trust level="Full" originUrl="" />

4.使用ASP.NET Handler(加在<system.web></system.web>里)
     
<httpHandlers>
        
<add verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax"/>
        
<add verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory, System.Web,Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
      
</httpHandlers>
posted @ 2007-09-27 15:36  没剑  阅读(2799)  评论(0编辑  收藏  举报