2010-06-01 137 views
0

我有一个应用程序,其中我访问驻留在App_Code文件夹中的CommonCode.cs文件中的会话对象。但是,当会话对象访问的应用程序会引发我一个错误:坚持启用会话状态

Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the \\ section in the application configuration.

现在我已经启用在Web.config文件中的会话状态属性,这里是从web.config文件我的代码:

<pages enableSessionState="true" autoEventWireup="true"> 
    <controls> 
     <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
     <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
    </controls> 
</pages> 

我不明白为什么我仍然得到那个错误! 请帮忙!

非常感谢。

回答