/// <summary> /// Get Cross Page Message to be displayed on different page /// </summary> public static CrossPageMessage GetCrossPageMessage(bool removeMessage) { if (HttpContext.Current.Session["CrossPageMessage"] == null || (!(HttpContext.Current.Session["CrossPageMessage"] is CrossPageMessage))) { return(null); } CrossPageMessage crossPageMessage = (CrossPageMessage)HttpContext.Current.Session["CrossPageMessage"]; if (removeMessage) { HttpContext.Current.Session.Remove("CrossPageMessage"); } return(crossPageMessage); }
/// <summary> /// Set Cross Page Message to be displayed on different page /// </summary> /// <param name="messageText"></param> /// <param name="messageType"></param> public static void SetCrossPageMessage(string messageText, MessageType messageType) { CrossPageMessage crossPageMessage = new CrossPageMessage(messageText, messageType); HttpContext.Current.Session["CrossPageMessage"] = crossPageMessage; }