Exemple #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));
 }
Exemple #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()
                                   ));
Exemple #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));
 }
Exemple #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);