Beispiel #1
0
 public static IHtmlContent SelectFieldFor <TModel, TValue>(
     this IHtmlHelper <TModel> html,
     Expression <Func <TModel, TValue> > expression,
     IEnumerable <QPSelectListItem> list,
     SelectOptions options)
 {
     return(html.SelectFieldFor(expression, list, null, options));
 }
Beispiel #2
0
 public static MvcHtmlString SelectFieldFor <TModel, TValue>(
     this HtmlHelper <TModel> html,
     Expression <Func <TModel, TValue> > expression,
     IEnumerable <QPSelectListItem> list,
     Dictionary <string, object> htmlAttributes = null,
     SelectOptions options = null,
     bool required         = false
     ) => MvcHtmlString.Create(string.Format(
                                   html.FieldTemplate(ExpressionHelper.GetExpressionText(expression), GetMetaData(html, expression).DisplayName, required: required),
                                   html.QpDropDownListFor(expression, list, htmlAttributes, options ?? new SelectOptions()).ToHtmlString()
                                   ));
Beispiel #3
0
 public static IHtmlContent SelectFieldFor <TModel, TValue>(
     this IHtmlHelper <TModel> html,
     Expression <Func <TModel, TValue> > expression,
     IEnumerable <QPSelectListItem> list,
     Dictionary <string, object> htmlAttributes = null,
     SelectOptions options = null,
     bool required         = false)
 {
     return(html.FieldTemplate(
                html.QpDropDownListFor(expression, list, htmlAttributes, options ?? new SelectOptions()),
                html.ModelExpressionProvider().GetExpressionText(expression),
                GetMetaData(html, expression).DisplayName,
                required: required));
 }
Beispiel #4
0
 public static MvcHtmlString SelectFieldFor <TModel, TValue>(
     this HtmlHelper <TModel> html,
     Expression <Func <TModel, TValue> > expression,
     IEnumerable <QPSelectListItem> list,
     SelectOptions options
     ) => html.SelectFieldFor(expression, list, null, options);