What is session's namespace

  • Thread starter Thread starter ad
  • Start date Start date
A

ad

I want to manage session in a class's property like:

public class HealthSession
{
private int SelClassID, SelGradeID;

public int ClassID_Sel
{
get
{return Session["ClassID_Sel"];}
set
{Session["ClassID_Sel"]=value;}
}

But the it cannot find the namespace of Session.

What is session's namespace?
 
ad ha scritto:
I want to manage session in a class's property like:

public class HealthSession
{
private int SelClassID, SelGradeID;

public int ClassID_Sel
{
get
{return Session["ClassID_Sel"];}
set
{Session["ClassID_Sel"]=value;}
}

But the it cannot find the namespace of Session.

What is session's namespace?

if you intend an ASP.NET Session the full class name should be
System.Web.SessionState.HttpSessionState
 
better to use httpcontext since sessionstate may not always be available to
the calling module. for instance, in httpmodules, it may not be available

--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_________________________


Antonio Pelleriti said:
ad ha scritto:
I want to manage session in a class's property like:

public class HealthSession
{
private int SelClassID, SelGradeID;

public int ClassID_Sel
{
get
{return Session["ClassID_Sel"];}
set
{Session["ClassID_Sel"]=value;}
}

But the it cannot find the namespace of Session.

What is session's namespace?

if you intend an ASP.NET Session the full class name should be
System.Web.SessionState.HttpSessionState
 
Back
Top