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 DropDownListBuilderTests()
 {
     dropDownList = DropDownListTestHelper.CreateDropDownList();
     builder      = new DropDownListBuilder(dropDownList);
 }
Exemple #4
0
 public static DropDownListBuilder SetValueTextDataSourceCustom(this DropDownListBuilder ddlb, string actionName, string controllerName, object routeValues)
 {
     return(SetValueTextDataSourceCustom(ddlb, actionName, controllerName, routeValues, ""));
 }
Exemple #5
0
 public static DropDownListBuilder SetValueTextDataSourceCustom(this DropDownListBuilder ddlb, string actionName, string controllerName)
 {
     return(SetValueTextDataSourceCustom(ddlb, actionName, controllerName, null));
 }
Exemple #6
0
 public static DropDownListBuilder SetReferenceSettings(this DropDownListBuilder ddlb)
 {
     ddlb.DataValueField("value").DataTextField("description").OptionLabel("select");
     return(ddlb);
 }
Exemple #7
0
 public static DropDownListBuilder SetValueTextSettings(this DropDownListBuilder ddlb, IEnumerable data)
 {
     ddlb.DataValueField("Value").DataTextField("Text").BindTo(data);
     return(ddlb);
 }
Exemple #8
0
 public static DropDownListBuilder SetValueTextSettings(this DropDownListBuilder ddlb)
 {
     ddlb.DataValueField("Value").DataTextField("Text");
     return(ddlb);
 }