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