enablesessionstate Page directive is needed to use the Session object

M

Marco Gerlach

Hello,

on IIS6 running on Win2003 server std. I get this error

"enablesessionstate Page directive is needed to use the Session object"



my web.config looks like this:

<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;user id=sa;password="
cookieless="false"
timeout="20"
/>
<pages validateRequest="false" enableSessionState="true"/>


my machine.config like this:

<pages buffer="true" enableSessionState="true"
enableViewState="true"
enableViewStateMac="true" autoEventWireup="true"
validateRequest="true" />
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
stateNetworkTimeout="10"
sqlConnectionString="data source=127.0.0.1;Integrated
Security=SSPI"
cookieless="false"
timeout="20"
/>


The defaults should be ok ?

If I Set
enableSessionState="true"
at page level, it works, but we have 1200 Pages so my goal is to use
the default settings from web.config. Where else can I look ?


Thanks,

Marco
 
R

Ravikanth[MVP]

Hi Marco

Try the following way:

<configuration>
<system.web>
<pages buffer="true"
enableSessionState="true"/>
</system.web>
</configuration>


HTH
Ravikanth
-----Original Message-----

Hello,

on IIS6 running on Win2003 server std. I get this error

"enablesessionstate Page directive is needed to use the Session object"



my web.config looks like this:

<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data
source=127.0.0.1;user id=sa;password="
 
M

Marco Gerlach

Hi Ravikanth,

in my settings enableSessionState in machine.config and web.config was set
to "true".

I added "buffer"=true but i didn't help.

Do you know other settings ?

Thanks,

Marco
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top