Example #1
0
        public Alert(IHtmlHelper helper, string title, Enums.AlertStyle style = Enums.AlertStyle.Success)
        {
            _writer = helper.ViewContext.Writer;
            var alertDiv = new TagBuilder("div");

            alertDiv.AddCssClass("alert");
            alertDiv.AddCssClass("alert-" + style.ToString().ToLower());
            alertDiv.Attributes.Add("role", "alert");
            alertDiv.TagRenderMode = TagRenderMode.StartTag;
            var strong = new TagBuilder("strong");

            strong.InnerHtml.Append(title);
            string html = ToString(alertDiv) + ToString(strong);

            _writer.Write(html);
        }
Example #2
0
 public static Alert Alert(this IHtmlHelper html, string title,
                           Enums.AlertStyle style = Enums.AlertStyle.Success)
 {
     return(new Alert(html, title, style));
 }
Example #3
0
 public IAlertFluent Warning()
 {
     _style = Enums.AlertStyle.Warning;
     return new AlertFluent(this);
 }
Example #4
0
 public IAlertFluent Success()
 {
     _style = Enums.AlertStyle.Success;
     return new AlertFluent(this);
 }
Example #5
0
 public IAlertFluent Info()
 {
     _style = Enums.AlertStyle.Info;
     return new AlertFluent(this);
 }
Example #6
0
 public IAlertFluent Danger()
 {
     _style = Enums.AlertStyle.Danger;
     return new AlertFluent(this);
 }