F
fniles
I am using Visual Studio 2005. In my ASPX page, when I try to use Session, I
got the 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 <configuration>\<system.web>\<httpModules> section in the
application configuration."
In my Web.config I put the following, but still I got the error above:
<system.web>
<pages autoEventWireup="true" enableSessionState="true"
enableViewState="true" enableViewStateMac="true" smartNavigation="true"
validateRequest="false">
<controls>
<add tagPrefix="asp" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
</controls>
</pages>
<compilation debug="true">
:
</compilation>
<httpHandlers>
:
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
</httpModules>
<!-- Enable in-process session state for application -->
<sessionState mode="InProc" cookieless="false" timeout="20"/>
</system.web>
How can I use the Session ? Thank you.
got the 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 <configuration>\<system.web>\<httpModules> section in the
application configuration."
In my Web.config I put the following, but still I got the error above:
<system.web>
<pages autoEventWireup="true" enableSessionState="true"
enableViewState="true" enableViewStateMac="true" smartNavigation="true"
validateRequest="false">
<controls>
<add tagPrefix="asp" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
</controls>
</pages>
<compilation debug="true">
:
</compilation>
<httpHandlers>
:
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
</httpModules>
<!-- Enable in-process session state for application -->
<sessionState mode="InProc" cookieless="false" timeout="20"/>
</system.web>
How can I use the Session ? Thank you.