public TagBuilder SetExtraTextInputValues(TagBuilder tb, bool isTextArea, BsSize size, bool?disabled) { if (size != BsSize.Normal) // annoying, but AddCssClass adds to the START of the class, instead of last one is last in the class, so put this before "form-control" { tb.AddCssClass(size.NameFormControl()); } tb.AddCssClass("form-control"); if (SetPlaceholder) { string placeholder = Placeholder.FirstNotNulle(LabelText).NullIfEmptyTrimmed(); if (placeholder.NotNulle()) { tb.Attributes["placeholder"] = placeholder; } } //if (Rows > 0) // inputTbx.Attributes["rows"] = Rows.ToString(); if (disabled == true) { tb.AddDisabledAttribute(disabled); } return(tb); }
public static string NamePagination(this BsSize val) { switch (val) { case BsSize.Normal: return(null); case BsSize.Small: return("pagination-sm"); case BsSize.Large: return("pagination-lg"); default: throw new ArgumentOutOfRangeException(); } }
public static string NameFormControl(this BsSize val) { switch (val) { case BsSize.Normal: return(null); case BsSize.Small: return("form-control-sm"); case BsSize.Large: return("form-control-lg"); default: throw new ArgumentOutOfRangeException(); } }