Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > enablesessionstate Page directive is needed to use the Session object

Reply
Thread Tools

enablesessionstate Page directive is needed to use the Session object

 
 
Marco Gerlach
Guest
Posts: n/a
 
      07-18-2003

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



 
Reply With Quote
 
 
 
 
Ravikanth[MVP]
Guest
Posts: n/a
 
      07-18-2003
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="
> 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
>
>
>
>.
>

 
Reply With Quote
 
 
 
 
Marco Gerlach
Guest
Posts: n/a
 
      07-18-2003

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


"Ravikanth[MVP]" <(E-Mail Removed)> schrieb im Newsbeitrag
news:09ab01c34d15$10faf500$(E-Mail Removed)...
> 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="
> > 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
> >
> >
> >
> >.
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Session not timing out with EnableSessionState set to false user_me ASP .Net 1 12-15-2004 05:56 PM
Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive David Lozzi ASP .Net 3 08-10-2004 12:44 AM
The 'Location' attribute is not supported by the 'OutPutCache' directive????when i set in the directive .NET Follower ASP .Net 1 02-13-2004 10:32 AM
Session state can only be used when EnableSessionState is set to true... error John Baughman ASP .Net 6 12-24-2003 06:50 AM
RE: Can't use Session in ASP.NET - enableSessionState error Jim Cheshire [MSFT] ASP .Net 3 08-04-2003 04:27 PM



Advertisments