Global.asax.cs and Session Object

G

Guest

Hi,

I want to add a an object to a Session in my global.asax.cs but am unable.

I try to do below in my Application_AuthenticateRequest

Session.Add("Employee", employee);

and I get an error stating "Session state is not available in this context. "

I have the following imports in my global.asax

using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.Security;
using System.Runtime.InteropServices;
using System.Security.Principal;
using eircomSAM.DomainLayer.People;


Any ideas as to what I am doing wrong?
 
M

Mark Rae

Any ideas as to what I am doing wrong?

1) Launch your internet browser (IE, FireFox, Mozilla, Netscape etc)

2) Navigate to http://www.google.com

3) Enter the text below in the box:

"Application_AuthenticateRequest" "Session state is not available in
this context"

4) Hit the button
 

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

Top