예제 #1
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;
     }
 }
예제 #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);
 }
예제 #4
0
 public static Button Button(this HtmlHelper html, string text, ButtonSettings settings, object htmlAttributes = null)
 {
     return(new Button(text, settings, htmlAttributes));
 }