public Button(string text, ButtonSettings settings, object htmlAttributes)
 {
     _text = text;
     _settings = settings ?? new ButtonSettings();
     HtmlAttributes = new HtmlAttributes(htmlAttributes);
     _settings.UpdateAttributes(HtmlAttributes);
     HtmlAttributes["class"] = "btn";
     if (_settings.Tag == Tag.Input)
     {
         HtmlTag = "input";
         HtmlAttributes["value"] = text;
     } else
     {
         HtmlTag = _settings.Tag.ToString().ToLower();
         InnerHtml = text;
     }
 }
Esempio n. 2
0
 public Button(string text, ButtonSettings settings, object htmlAttributes)
 {
     _text          = text;
     _settings      = settings ?? new ButtonSettings();
     HtmlAttributes = new HtmlAttributes(htmlAttributes);
     _settings.UpdateAttributes(HtmlAttributes);
     HtmlAttributes["class"] = "btn";
     if (_settings.Tag == Tag.Input)
     {
         HtmlTag = "input";
         HtmlAttributes["value"] = text;
     }
     else
     {
         HtmlTag   = _settings.Tag.ToString().ToLower();
         InnerHtml = text;
     }
 }
 public static Button Button(this HtmlHelper html, string text, ButtonSettings settings, object htmlAttributes = null)
 {
     return new Button(text, settings, htmlAttributes);
 }
Esempio n. 4
0
 public static Button Button(this HtmlHelper html, string text, ButtonSettings settings, object htmlAttributes = null)
 {
     return(new Button(text, settings, htmlAttributes));
 }