public static MvcHtmlString ShowStatusMessage(this HtmlHelper htmlHelper, UtilityEnum.StatusMessageType messageType = UtilityEnum.StatusMessageType.Success, string messageText = null, object htmlAttributes = null)
        {
            // required for legacy webform pages
            if (htmlHelper == null)
                return MvcHtmlString.Empty;

            var tempData = htmlHelper.ViewContext.TempData;

            if (string.IsNullOrEmpty(messageText))
            {
                messageText = (string)tempData[Constants.StatusMessage.StatusMessageText];
            }

            if (string.IsNullOrEmpty(messageText))
                return MvcHtmlString.Empty;

            // if dictionary contains keys for type use appropriate StatusMessage overload
            if (tempData["StatusMessageType"] != null)
            {
                messageType = (UtilityEnum.StatusMessageType)tempData[Constants.StatusMessage.StatusMessageType];
            }

            var innerSpan = new TagBuilder("span") { InnerHtml = messageText };

            var outerDiv = new TagBuilder("div")
            {
                InnerHtml = "<button type='button' class='close' data-dismiss='alert'" +
                            " aria-hidden='true'>&times;</button>" +
                            innerSpan
            };

            var attribs = htmlAttributes == null ? new RouteValueDictionary() : new RouteValueDictionary(htmlAttributes);
            outerDiv.MergeAttributes(attribs);
            outerDiv.AddCssClass("alert alert-dismissable");

            switch (messageType)
            {
                case UtilityEnum.StatusMessageType.Success:
                    outerDiv.AddCssClass("alert-success");
                    break;

                case UtilityEnum.StatusMessageType.Info:
                    outerDiv.AddCssClass("alert-info");
                    break;

                case UtilityEnum.StatusMessageType.Warning:
                    outerDiv.AddCssClass("alert-warning");
                    break;

                case UtilityEnum.StatusMessageType.Danger:
                    outerDiv.AddCssClass("alert-danger");
                    break;
            }

            return MvcHtmlString.Create(outerDiv.ToString());
        }
 public static void SetStatusMessage(this TempDataDictionary tempData, string message, UtilityEnum.StatusMessageType messageType = UtilityEnum.StatusMessageType.Success)
 {
     tempData[Constants.StatusMessage.StatusMessageText] = message;
     tempData[Constants.StatusMessage.StatusMessageType] = messageType;
 }