Class Constructor!!!

A

Adam Knight

Hi all,

below is a class constructor i have written.

I am getting the error: Security.Session denotes a field where a method was
expected.

Can someone give me a heads up on what is happening!!

Cheers,
Adam

public Security()
{
//default property values
_IsDirector = false;
_IsAdmin = false;
_IsUser = false;

if(!null = System.Web.HttpContext.Current.Session)
{
//retrieve session object from page
Session = System.Web.HttpContext.Current.Session;

//initialise class properties
switch (Session("GroupID")) //error here
{
case 1:
_IsDirector = true;
break;
case 2:
_IsAdmin = true;
break;
case 3:
_IsUser = true;
}
}
}
 

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