Hi,
In default.aspx, I set some session variables.
Session["UserID"] = "100";
I have lot of class files in my project where I need the above UserID value.
I discovered that I cant use the Session variables in a class file directly, as below
string ID = Session["UserID"]; //does not work in class file
How else can I access the session variable frm the classes?
What I would like to do, is write a function that takes a string parameter, and return a session variable value..
like
public getSessionVarValue(string s)
{
return Session["s"];
}
how and where can I write this function..?