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

Home Posts Topics Members FAQ

Receiving error about enableSessionSt ate; Its already set to true

I keep getting this error.
"Session state can only be used when enableSessionSt ate 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("Na meplate", 1)
....

That is in a button click event.

I've seen many forum entries about this but no suggestions seem to work. I
could use some more leads.

Thanks,

Sean

Nov 18 '05 #1
3 2238
Sean,
If you look at the error message, you can glean that maybe session state
isn't enabled on your page. Do you have EnableSessionSt ate="true" in your
@Page directive? Is EnableSessionSt ate false in your web.config file? If
you can post a page and web.config file, then the problem can be diagnosed.

Another test to use:
Comment out your Session.Add() line and enter Trace.Warn(Enab leSessionState)
Then look at your trace content to see if you get true or false. If you are
unfamiliar with Trace, you can use Response.Write( EnableSessionSt ate) to get
the value.

Best regards,
Jeffrey Palermo

"Sean W." <Sean W.@discussions. microsoft.com> wrote in message
news:AD******** *************** ***********@mic rosoft.com...
I keep getting this error.
"Session state can only be used when enableSessionSt ate 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("Na meplate", 1)
...

That is in a button click event.

I've seen many forum entries about this but no suggestions seem to work. I could use some more leads.

Thanks,

Sean

Nov 18 '05 #2
Jeffrey,
Thanks for a response.

I have already tried to force EnableSessionSt ate=true in the page directive
of the two pages. Also in web.config it looks like

<sessionState
mode="InProc"
cookieless="fal se"
timeout="20"
EnableSessionSt ate="True"
/>

I tried to put in Response.Write( EnableSessionSt ate) but enablesessionst ate
is not a recognized object. Keep in mind this is in the VB file that is a
"Code Behind", should it matter.

Thanks,

Sean

Nov 18 '05 #3
Sean,
This problem has happened to some others (try pasting the error message
in a google groups search). Delete the IIS application and recreate a new
virtual directory in IIS. Set it as an application, and then put your VS
project in this new IIS directory. That has fixed the problem for some
others. It's not a code problem.

Best regards,
Jeffrey Palermo

"Sean W." <Se***@discussi ons.microsoft.c om> wrote in message
news:0C******** *************** ***********@mic rosoft.com...
Jeffrey,
Thanks for a response.

I have already tried to force EnableSessionSt ate=true in the page directive of the two pages. Also in web.config it looks like

<sessionState
mode="InProc"
cookieless="fal se"
timeout="20"
EnableSessionSt ate="True"
/>

I tried to put in Response.Write( EnableSessionSt ate) but enablesessionst ate is not a recognized object. Keep in mind this is in the VB file that is a
"Code Behind", should it matter.

Thanks,

Sean

Nov 18 '05 #4

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

Similar topics

6
3281
by: John Baughman | last post by:
I migrated a Sharepoint Team Services website to a Sharepoint website on Windows 2003. The site was working well on the old server. After the migration any asp.net page that uses session variables no longer works. I get the subject error. The directory with the asp pages is NOT a managed path in Sharepoint. The default page does not use Session State so opens fine. All the links from that page use session state and none of them...
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
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:
0
1014
by: planetreddy | last post by:
Hello, I have customised some aspx pages & want to view these pages in PWA. But whenever I try to open this page through PWA I get the following error "Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive"
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;
2
2099
by: ras26 | last post by:
I have a WebSite "App1" which has an external assembly "Lib1". Inside this external assembly we have developed some classes that derive from "System.Web.UI.Page". One of these pages is called "WebNotification". In the WebSite "App1" we create an instance of "WebNotification", but when this class tries to access some Session variables it generates the following error: Session state can only be used when enableSessionState is set to...
2
1255
by: WhiskyRomeo | last post by:
Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive This error only occurs while I am debugging. The code is production code that has been running successfully for over year. I did not get this error yesterday while debugging this same code. Today, however, I did allow windows XP to install automatic updates. So something must have changed in the .NetFrameWork...
1
1117
by: anishrnair | last post by:
The error that had generated is the given below System.Web.HttpException: 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 \\ section in the application configuration. at System.Web.UI.Page.get_Session() at Default5.btnSignIn_Click(Object sender, EventArgs...
4
2525
by: Cirene | last post by:
In my web.config I added <pages enableSessionState="true">. In each of my pages I also added EnableSessionState="True" to the Page declaration. (I didn't think this was necessary, but...) Any reason why even though I did this I keep getting this error.... Server Error in '/abc' Application.
0
9977
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11556
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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...
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
6106
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3533
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.