Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Receiving error about enableSessionState; Its already set to true

Reply
Thread Tools

Receiving error about enableSessionState; Its already set to true

 
 
=?Utf-8?B?U2VhbiBXLg==?=
Guest
Posts: n/a
 
      11-24-2004
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.

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

Thanks,

Sean

 
Reply With Quote
 
 
 
 
Jeffrey Palermo [MCP]
Guest
Posts: n/a
 
      11-24-2004
Sean,
If you look at the error message, you can glean that maybe session state
isn't enabled on your page. Do you have EnableSessionState="true" in your
@Page directive? Is EnableSessionState 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(EnableSessionState)
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(EnableSessionState) to get
the value.

Best regards,
Jeffrey Palermo

"Sean W." <Sean (E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
> I've seen many forum entries about this but no suggestions seem to work.

I
> could use some more leads.
>
> Thanks,
>
> Sean
>



 
Reply With Quote
 
 
 
 
=?Utf-8?B?U2VhbiBXLg==?=
Guest
Posts: n/a
 
      11-24-2004
Jeffrey,
Thanks for a response.

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

<sessionState
mode="InProc"
cookieless="false"
timeout="20"
EnableSessionState="True"
/>

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

Thanks,

Sean
>

 
Reply With Quote
 
Jeffrey Palermo [MCP]
Guest
Posts: n/a
 
      11-25-2004
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." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Jeffrey,
> Thanks for a response.
>
> I have already tried to force EnableSessionState=true in the page

directive
> of the two pages. Also in web.config it looks like
>
> <sessionState
> mode="InProc"
> cookieless="false"
> timeout="20"
> EnableSessionState="True"
> />
>
> I tried to put in Response.Write(EnableSessionState) but

enablesessionstate
> is not a recognized object. Keep in mind this is in the VB file that is a
> "Code Behind", should it matter.
>
> Thanks,
>
> Sean
> >



 
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
Its a bird, its a plane, its.. um, an Attribute based System? thunk Ruby 14 04-03-2010 10:08 AM
Its a bird, its a plane, its.. um, an Attribute based System? thunk Ruby 0 04-01-2010 10:25 PM
Its a bird, its a plane, no ummm, its a Ruide thunk Ruby 1 03-30-2010 11:10 AM
Re: ITS FUNNEH CAUSE ITS TRUE! chuckcar Computer Support 2 03-27-2010 10:34 PM
[False,True] and [True,True] --> [True, True]????? bdb112 Python 45 04-29-2009 02:35 AM



Advertisments