Example #1
0
        private static BootstrapDropDown DropDownHelper(this HtmlHelper htmlHelper, IDictionary <string, object> htmlAttributes, FormDropDownOptions options)
        {
            BootstrapDropDown dropdown = new BootstrapDropDown(htmlHelper.ViewContext, htmlAttributes);

            if (options != null)
            {
                dropdown.FieldName  = options.Name;
                dropdown.FieldValue = options.Value;
                dropdown.Options    = options.Options;
            }

            return(dropdown);
        }
Example #2
0
 public static MvcHtmlString FormDropDown(this HtmlHelper html, FormDropDownOptions options, dynamic additionalViewData = null)
 {
     return(DropDownHelper(html, HtmlHelper.AnonymousObjectToHtmlAttributes(additionalViewData), options).ToMvcHtmlString());
 }