public static MvcHtmlString GetMessage(this HtmlHelper html)
        {
            TempDataDictionary tempData = html.ViewContext.TempData;

            if (tempData.IsMessageExists())
            {
                string messageTypeClass = tempData.GetMessageTypeClass("");
                string imageHtml        = html.SpriteImage("", "msgImg " + messageTypeClass + "Img").ToString();
                return
                    (MvcHtmlString.Create(string.Format(MessageHtmlTemplate, tempData.GetMessage(), messageTypeClass,
                                                        imageHtml)));
            }
            return(MvcHtmlString.Empty);
        }
Example #2
0
 public static bool HasMessage(this TempDataDictionary TempData)
 {
     return(!string.IsNullOrWhiteSpace(TempData.GetMessage()));
 }
 public static bool IsMessageExists(this TempDataDictionary tempData)
 {
     return(!string.IsNullOrWhiteSpace(tempData.GetMessage()));
 }