public void Remove(SessionEnum key) { if (HttpContext.Current.Session[key.ToString()] != null) { HttpContext.Current.Session.Remove(key.ToString()); } }
public static void Remove(SessionEnum key) { if (HttpContext.Current.Session == null || HttpContext.Current.Session[key.ToString()] == null) { return; } HttpContext.Current.Session.Remove(key.ToString()); }
public static void SetSessionObject(SessionEnum key, object value) { if (HttpContext.Current.Session[key.ToString()] != null) { Remove(key); } HttpContext.Current.Session.Add(key.ToString(), value); }
public static object GetSessionObject(SessionEnum key) { if (HttpContext.Current == null || HttpContext.Current.Session == null || HttpContext.Current.Session[key.ToString()] == null) { return(null); } return(HttpContext.Current.Session[key.ToString()]); }
public T Get <T>(SessionEnum key) where T : class { if (HttpContext.Current.Session != null) { object RetObject = HttpContext.Current.Session[key.ToString()]; if (RetObject != null) { return((T)RetObject); } } return(null); }
public void Set(object obj, SessionEnum key) { HttpContext.Current.Session[key.ToString()] = obj; }
public object Get(SessionEnum key) { return(HttpContext.Current.Session[key.ToString()]); }