session state in ASP.NET

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.
 
A

Alexander Kaplunov

It is. Here is what it looks like:

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

Thanks,
Alex.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top