I\'m using the session to hold a custom object UserSession and I access the session like this:
UserSession TheSession = HttpContext.Current.Session[\"UserSes
create a static class with static properties:
public static class UserSession
{
public static int UserID
{
get { return Convert.ToInt32(Session["userID"]); }
set { Session["userID"] = value; }
}
}
When u use it:
UserSession.UserID = 23;
Response.Write(UserSession.UserID);
it will use the session variable to store information passed to this property.