Пример #1
0
        public static string GetMessageHtml(Control control)
        {
            var messageType = Message.EMessageType.None;
            var message     = string.Empty;

            if (CookieUtils.IsExists(Message.GetCookieName(Message.EMessageType.Success)))
            {
                messageType = Message.EMessageType.Success;
                message     = CookieUtils.GetCookie(Message.GetCookieName(Message.EMessageType.Success));
                CookieUtils.Erase(Message.GetCookieName(Message.EMessageType.Success));
            }
            else if (CookieUtils.IsExists(Message.GetCookieName(Message.EMessageType.Error)))
            {
                messageType = Message.EMessageType.Error;
                message     = CookieUtils.GetCookie(Message.GetCookieName(Message.EMessageType.Error));
                CookieUtils.Erase(Message.GetCookieName(Message.EMessageType.Error));
            }
            else if (CookieUtils.IsExists(Message.GetCookieName(Message.EMessageType.Info)))
            {
                messageType = Message.EMessageType.Info;
                message     = CookieUtils.GetCookie(Message.GetCookieName(Message.EMessageType.Info));
                CookieUtils.Erase(Message.GetCookieName(Message.EMessageType.Info));
            }
            return(GetMessageHtml(messageType, message, control));
        }
Пример #2
0
 public static void SaveMessage(Message.EMessageType messageType, string message)
 {
     CookieUtils.SetCookie(Message.GetCookieName(messageType), message, DateTime.MaxValue);
 }