473,946 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

enablesessionst ate Page directive is needed to use the Session object


Hello,

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

"enablesessions tate Page directive is needed to use the Session object"

my web.config looks like this:

<sessionState
mode="InProc"
stateConnection String="tcpip=1 27.0.0.1:42424"
sqlConnectionSt ring="data source=127.0.0. 1;user id=sa;password= "
cookieless="fal se"
timeout="20"
/>
<pages validateRequest ="false" enableSessionSt ate="true"/>
my machine.config like this:

<pages buffer="true" enableSessionSt ate="true"
enableViewState ="true"
enableViewState Mac="true" autoEventWireup ="true"
validateRequest ="true" />
<sessionState
mode="InProc"
stateConnection String="tcpip=1 27.0.0.1:42424"
stateNetworkTim eout="10"
sqlConnectionSt ring="data source=127.0.0. 1;Integrated
Security=SSPI"
cookieless="fal se"
timeout="20"
/>
The defaults should be ok ?

If I Set
enableSessionSt ate="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 23330
Hi Marco

Try the following way:

<configuratio n>
<system.web>
<pages buffer="true"
enableSessionSt ate="true"/>
</system.web>
</configuration>
HTH
Ravikanth
-----Original Message-----

Hello,

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

"enablesession state Page directive is needed to use the Session object"
my web.config looks like this:

<sessionState
mode="InProc"
stateConnection String="tcpip=1 27.0.0.1:42424"
sqlConnectionSt ring="data source=127.0.0. 1;user id=sa;password= " cookieless="fal se"
timeout="20"
/>
<pages validateRequest ="false" enableSessionSt ate="true"/>

my machine.config like this:

<pages buffer="true" enableSessionSt ate="true"
enableViewStat e="true"
enableViewState Mac="true" autoEventWireup ="true"validateReques t="true" />
<sessionState
mode="InProc"
stateConnection String="tcpip=1 27.0.0.1:42424"
stateNetworkTim eout="10"
sqlConnectionSt ring="data source=127.0.0. 1;IntegratedSecurity=SSP I"
cookieless="fal se"
timeout="20"
/>
The defaults should be ok ?

If I Set
enableSessionS tate="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 enableSessionSt ate in machine.config and web.config was set
to "true".

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

Do you know other settings ?

Thanks,

Marco
"Ravikanth[MVP]" <dv*********@ho tmail.com> schrieb im Newsbeitrag
news:09******** *************** *****@phx.gbl.. .
Hi Marco

Try the following way:

<configuratio n>
<system.web>
<pages buffer="true"
enableSessionSt ate="true"/>
</system.web>
</configuration>
HTH
Ravikanth
-----Original Message-----

Hello,

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

"enablesession state Page directive is needed to use the

Session object"

my web.config looks like this:

<sessionState
mode="InProc"
stateConnection String="tcpip=1 27.0.0.1:42424"
sqlConnectionSt ring="data

source=127.0.0. 1;user id=sa;password= "
cookieless="fal se"
timeout="20"
/>
<pages validateRequest ="false"

enableSessionSt ate="true"/>


my machine.config like this:

<pages buffer="true" enableSessionSt ate="true"
enableViewStat e="true"
enableViewState Mac="true"

autoEventWireup ="true"
validateReques t="true" />
<sessionState
mode="InProc"
stateConnection String="tcpip=1 27.0.0.1:42424"
stateNetworkTim eout="10"
sqlConnectionSt ring="data

source=127.0.0. 1;Integrated
Security=SSP I"
cookieless="fal se"
timeout="20"
/>
The defaults should be ok ?

If I Set
enableSessionS tate="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
3544
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 installed. On the Windows 2003 server my default.aspx page opens fine, but when I link to another page I get the following error: "Session state can only be used when enableSessionStae is set to true, either in a configuration file or in the Page...
6
2272
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 Session object from code-behind to in-page and it worked. Didn't find an explanation though but it got me up again. Today it got worse. Now what sense does this make:
0
1755
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 adding the dataset to the session, I can view it in my Watch window. The watch window also shows that the session is readonly. I would expect an exception when adding something to a readonly session.
3
7020
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: Line 6: Dim sqlQry as string = "INSERT INTO logs (UID,Note,Description) VALUES " & Session.Contents("UID") & ", 'LOGOUT',''"
3
2239
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 session variable. .... Session.Add("Nameplate", 1) .... That is in a button click event.
1
2046
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 XMLHTTP to retrieve some information from "myPage.aspx" myPage.aspx contains EnableSessionState="false" in its Page directive and has C# code behind.
0
1244
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 data is written to the dictionary I redirect to another page and read the values. My Code:
6
16055
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 fnGetShoppingCartText() { if (Session != null) { ArrayList cart = (ArrayList)Session;
3
34488
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 Page and place the code in there. Then each webpage will inherit from my modified page class. This works fine, but if I try and access the Session from the modified page class, I get the following error: Session state can only be used when...
0
10151
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11150
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11333
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10685
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9883
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8245
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7412
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6327
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3538
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.