C
Cirene
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.
--------------------------------------------------------------------------------
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 <configuration>\<system.web>\<httpModules> section in the
application configuration.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
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. Please also make sure that System.Web.SessionStateModule
or a custom session state module is included in the
<configuration>\<system.web>\<httpModules> section in the application
configuration.
Source Error:
Line 3: Inherits System.Web.UI.Page
Line 4:
Line 5: Dim c As abcshoppingcart = Session("Cart")
Line 6:
Line 7: Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Source File: F:\work-related\websites\abc\Projects.aspx.vb Line: 5
Stack Trace:
[HttpException (0x80004005): 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
<configuration>\<system.web>\<httpModules> section in the application
configuration.]
System.Web.UI.Page.get_Session() +2634804
Projects..ctor() in F:\work-related\websites\abc\Projects.aspx.vb:5
ASP.projects_aspx..ctor() in
F:\work-related\websites\abc\Projects.aspx.vb:912304
__ASP.FastObjectFactory_app_web_kwdoldj8.Create_ASP_projects_aspx() +47
System.Web.Compilation.BuildResultCompiledType.CreateInstance() +32
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath
virtualPath, Type requiredBaseType, HttpContext context, Boolean
allowCrossApp, Boolean noAssert) +119
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context,
String requestType, VirtualPath virtualPath, String physicalPath) +33
System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext
context, String requestType, VirtualPath virtualPath, String physicalPath)
+40
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String
requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
+160
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+93
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +155
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.
--------------------------------------------------------------------------------
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 <configuration>\<system.web>\<httpModules> section in the
application configuration.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
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. Please also make sure that System.Web.SessionStateModule
or a custom session state module is included in the
<configuration>\<system.web>\<httpModules> section in the application
configuration.
Source Error:
Line 3: Inherits System.Web.UI.Page
Line 4:
Line 5: Dim c As abcshoppingcart = Session("Cart")
Line 6:
Line 7: Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Source File: F:\work-related\websites\abc\Projects.aspx.vb Line: 5
Stack Trace:
[HttpException (0x80004005): 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
<configuration>\<system.web>\<httpModules> section in the application
configuration.]
System.Web.UI.Page.get_Session() +2634804
Projects..ctor() in F:\work-related\websites\abc\Projects.aspx.vb:5
ASP.projects_aspx..ctor() in
F:\work-related\websites\abc\Projects.aspx.vb:912304
__ASP.FastObjectFactory_app_web_kwdoldj8.Create_ASP_projects_aspx() +47
System.Web.Compilation.BuildResultCompiledType.CreateInstance() +32
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath
virtualPath, Type requiredBaseType, HttpContext context, Boolean
allowCrossApp, Boolean noAssert) +119
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context,
String requestType, VirtualPath virtualPath, String physicalPath) +33
System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext
context, String requestType, VirtualPath virtualPath, String physicalPath)
+40
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String
requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
+160
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+93
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +155