473,404 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

enablesessionstate Page directive is needed to use the Session object


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

Nov 17 '05 #1
2 23295
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;IntegratedSecurity=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 usethe default settings from web.config. Where else can I look ?

Thanks,

Marco

.

Nov 17 '05 #2

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]" <dv*********@hotmail.com> schrieb im Newsbeitrag
news:09****************************@phx.gbl...
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

.

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: John Baughman | last post by:
I am attempting to move my asp.net application to Windows Server 2003 with Windows Sharepoint Services (beta) installed. The application was working fine in 2000 with Sharepoint Team Services...
6
by: Martin | last post by:
Hi, I had a page the other day for which the compiler just wouldn't recognize the fact that I had enabled session state in every possible way. I ended up moving the code that dealt with the...
0
by: Jeffry van de Vuurst | last post by:
Hi, I have a page with EnableSessionState=readonly in the page directive. A couple of strange things happen. When I try to add something to the session, I get no exception. Immediately after...
3
by: David Lozzi | last post by:
Error: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive at line 6 Line 4: <script RUNAT="SERVER"> Line 5: ...
3
by: Sean W. | last post by:
I keep getting this error. "Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive" This occurs when I try to add a...
1
by: user_me | last post by:
I have a page with function 'myFunction()' that contains a call to window.setTimeout("myFunction()", delay, "javascript") to invoke itself every 'delay' minutes. The function 'myFunction()' uses...
0
by: Rick | last post by:
I am getting a "Session state can only be used when enableSessionState is set to true" error. it works on the first form where I am writing some data to a dictionary(Dictionarybase). After the...
6
by: KevinGravelle | last post by:
What is wrong with this picture? I'm trying to set my shopping cart text on my home page using the following function that is executed when the class is constructed: protected string...
3
by: Paul | last post by:
Hi All, In my application, I wished to check certain things on each page load, so rather than paste the same code in each pages constructor, I thought it would be more logical to inherit from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.