public void Build() { var htmlHelper = MvcHelper.GetHtmlHelper(); var select = new DropDownList(htmlHelper); var builder = new DropDownListBuilder(select); builder .Name("test") .Placeholder("-- Select --") .DataValueField("Value") .DataTextField("Text"); var html = builder.ToHtmlString(); }
public DropDownListBuilderTests() { dropDownList = DropDownListTestHelper.CreateDropDownList(); builder = new DropDownListBuilder(dropDownList); }
public static DropDownListBuilder SetValueTextDataSourceCustom(this DropDownListBuilder ddlb, string actionName, string controllerName, object routeValues) { return(SetValueTextDataSourceCustom(ddlb, actionName, controllerName, routeValues, "")); }
public static DropDownListBuilder SetValueTextDataSourceCustom(this DropDownListBuilder ddlb, string actionName, string controllerName) { return(SetValueTextDataSourceCustom(ddlb, actionName, controllerName, null)); }
public static DropDownListBuilder SetReferenceSettings(this DropDownListBuilder ddlb) { ddlb.DataValueField("value").DataTextField("description").OptionLabel("select"); return(ddlb); }
public static DropDownListBuilder SetValueTextSettings(this DropDownListBuilder ddlb, IEnumerable data) { ddlb.DataValueField("Value").DataTextField("Text").BindTo(data); return(ddlb); }
public static DropDownListBuilder SetValueTextSettings(this DropDownListBuilder ddlb) { ddlb.DataValueField("Value").DataTextField("Text"); return(ddlb); }