stuck with enable session state

Posted by Shrewd Demon on Stack Overflow See other posts from Stack Overflow or by Shrewd Demon
Published on 2010-06-01T12:04:42Z Indexed on 2010/06/01 12:43 UTC
Read the original article Hit count: 341

Filed under:
|
|

hi

i have an application wherein i am accessing the Session object in the CommonCode.cs file that resides in the App_Code folder. But when the session object is accessed the application throws me an error:

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.

Now i have already enabled the session state property in the web.config file, here is my code from the web.config file:

<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>

I dont understand why am i still getting that error !! please help !

thanks a lot.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about session-state