What is session's namespace?

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;}
}


What is session's namespace?
 
S

Scott Allen

You'll need more than just the namespace, you'll need an object with a
Session property. Session["foo"] works inside of a method in a webform
class because the Page object has a Session property.

Hint: look at HttpContext.Current ...
 

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

Members online

Forum statistics

Threads
474,264
Messages
2,571,066
Members
48,770
Latest member
ElysaD

Latest Threads

Top