I am NOT using MVC, URL rewriting, custom HTTP modules, etc. On a basic call to the Session property off of either a web page inheriting System.Web.UI.Page or via System.Web.HttpContext.Current.Session, 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. 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.
After doing some research, I have implemented Web.config as follows, but the error still occurs. I am debugging the web app out of Visual Studio 2010 using the built-in web server.
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<sessionState mode="InProc" timeout="60" cookieless="false" />
<pages enableSessionState="true" />
<httpModules>
<remove name="Session" />
<add name="Session" type="System.Web.SessionState.SessionStateModule" />
</httpModules>
</system.web>
</configuration>
EnableSessionState="false"
in the page directive of Home.aspx (<%@ Page ...
at the top of the .aspx)? – csm8118