Beispiel #1
0
        public static MvcHtmlString CheckBoxListFor <TModel, TProperty>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, IList <string> lists, RepeatDirection repeatDirection = RepeatDirection.Horizontal)
        {
            ModelMetadata metadata          = ModelMetadata.FromLambdaExpression <TModel, TProperty>(expression, htmlHelper.ViewData);
            string        name              = ExpressionHelper.GetExpressionText(expression);
            string        fullHtmlFieldName = htmlHelper.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldName(name);

            return(ListControlUtil.GenerateHtml(fullHtmlFieldName, lists, repeatDirection, "checkbox", metadata.Model));
        }
Beispiel #2
0
 public static MvcHtmlString CheckBoxList(this HtmlHelper htmlHelper, string name, IList <string> lists, RepeatDirection repeatDirection = RepeatDirection.Horizontal)
 {
     return(ListControlUtil.GenerateHtml(name, lists, repeatDirection, "checkbox", null));
 }
Beispiel #3
0
 public static MvcHtmlString RadioButtonList(this HtmlHelper htmlHelper, string name, IList <string> lists, RepeatDirection repeatDirection = RepeatDirection.Horizontal)
 {
     return(ListControlUtil.GenerateHtml(name, lists, repeatDirection, "radio", null));
 }