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