Session State Errors

  • Thread starter Thread starter Joshua A. Booker
  • Start date Start date
J

Joshua A. Booker

Hi,

I'm new to ASP.Net. I'm getting this error in the Time Tracker Starter Kit
Web App:

Exception Details: 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

Source File: D:\Program Files\ASP.NET Starter Kits\ASP.NET TimeTracker
(VBVS)\TTWebVBVS\ProjectDetails.aspx.vb Line: 77

The session state in the webconfig is:
<sessionState mode="InProc" cookieless="false" timeout="20" />

I don't know of any enableSessionState setting. Can someone direct me to
some helpful info.

TIA,
Josh
 
Hi Joshua,

Assuming you have some knowledge about sessions in asp.net,if not read
the following link :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspnet/html/asp12282000.asp

Even if you are not using sessions in your asp.net pages,sessions carry
some overhead for an application.
You can get little more performance out of your asp.net pages if you turn
off sessions on pages that do not use it.
Also setting session state to read-only can also optimize pages that read
but do not write data to the sessions.
You can configure sessions by adding an attribute to the @Page directive in
each of your asp.net pages:
<%@ Page EnableSessionState="false" %>
and for read only
<%@ Page EnableSessionState="readonly" %>
Session state can be configured in Web.Config and or Machine.Config
In Web.Config :

<sessionState timeout="20" cookieless="false" mode="Inproc" /> can be the
setting. Your error can be due to EnableSessionState="false" on a
particular page and you are trying
to access or write session information on that page.Hope this
helps.Regards,Marshal Antony.NET Developerhttp://www.dotnetmarshal.com
 
Back
Top