The DropDownHelper class
Наследование: IBootstrapComponent
        /// <summary>
        /// Renders the menu drop down component.
        /// </summary>
        /// <param name="helper">The helper.</param>
        /// <param name="name">The name.</param>
        /// <param name="selectList">The select list.</param>
        /// <param name="optionLabel">The option label.</param>
        /// <param name="htmlAttributes">The HTML attributes.</param>
        /// <returns></returns>
        public static MvcHtmlString MenuDropDown(this HtmlHelper helper, string name, IEnumerable <MenuItem> selectList, string optionLabel = null, object htmlAttributes = null)
        {
            DropDownHelper dropDownHelper = new DropDownHelper(helper, name, selectList, optionLabel, htmlAttributes);

            return(new MvcHtmlString(dropDownHelper.Render()));
        }
Пример #2
0
 /// <summary>
 /// Renders the menu drop down component.
 /// </summary>
 /// <param name="helper">The helper.</param>
 /// <param name="name">The name.</param>
 /// <param name="selectList">The select list.</param>
 /// <param name="optionLabel">The option label.</param>
 /// <param name="htmlAttributes">The HTML attributes.</param>
 /// <returns></returns>
 public static MvcHtmlString MenuDropDown(this HtmlHelper helper, string name, IEnumerable<MenuItem> selectList, string optionLabel=null, object htmlAttributes=null)
 {
     DropDownHelper dropDownHelper = new DropDownHelper(helper, name, selectList, optionLabel, htmlAttributes);
     return new MvcHtmlString(dropDownHelper.Render());
 }