session state in ASP.NET

  • Thread starter Thread starter Alexander Kaplunov
  • Start date Start date
A

Alexander Kaplunov

Hello,

I'm trying to use session state but get a runtime error. Here is what I'm
trying to do in my code-behind file:

Account acct = (Account) Session["login.account"];

in the aspx file the Page directive looks like the following:

<%@ Page language="c#" Codebehind="login.aspx.cs" AutoEventWireup="false"
Inherits="DigitalB.login" EnableSessionState=true %>

Here is the runtime error I'm getting:

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

I appreciate any help.
Thanks,
Alex.
 
It is. Here is what it looks like:

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

Thanks,
Alex.
 
Back
Top