Esempio n. 1
0
 public MvcHtmlString DropDownListFor <TValue>(Expression <Func <TModel, TValue> > expression,
                                               IEnumerable <SelectListItem> selectList,
                                               IDictionary <string, object> htmlAttributes)
 {
     AddFormControlCssClass(htmlAttributes);
     GdsExtensions.AddClass(htmlAttributes, "govuk-select");
     return(htmlHelper.DropDownListFor(expression, selectList, htmlAttributes));
 }
Esempio n. 2
0
        public MvcHtmlString TextBoxFor <TValue>(Expression <Func <TModel, TValue> > expression,
                                                 IDictionary <string, object> htmlAttributes)
        {
            AddFormControlCssClass(htmlAttributes);
            /* SG */
            GdsExtensions.AddClass(htmlAttributes, CssTextClass);

            return(htmlHelper.TextBoxFor(expression, htmlAttributes));
        }
Esempio n. 3
0
        public MvcHtmlString DropDownListFor <TValue>(Expression <Func <TModel, TValue> > expression,
                                                      IEnumerable <SelectListItem> selectList,
                                                      string optionLabel)
        {
            var routeValues = new RouteValueDictionary();

            AddFormControlCssClass(routeValues);
            GdsExtensions.AddClass(routeValues, "govuk-select");
            return(htmlHelper.DropDownListFor(expression, selectList, optionLabel: optionLabel, htmlAttributes: routeValues));
        }
Esempio n. 4
0
        public MvcHtmlString DropDownListFor <TValue>(Expression <Func <TModel, TValue> > expression,
                                                      IEnumerable <SelectListItem> selectList,
                                                      string optionLabel,
                                                      object htmlAttributes)
        {
            var routeValueDictionary = System.Web.Mvc.HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes);

            AddFormControlCssClass(routeValueDictionary);
            GdsExtensions.AddClass(routeValueDictionary, "govuk-select");
            return(htmlHelper.DropDownListFor(expression, selectList, optionLabel: optionLabel, htmlAttributes: routeValueDictionary));
        }
Esempio n. 5
0
        public MvcHtmlString PasswordFor <TValue>(Expression <Func <TModel, TValue> > expression,
                                                  IDictionary <string, object> htmlAttributes)
        {
            AddFormControlCssClass(htmlAttributes);

            GdsExtensions.AddClass(htmlAttributes, CssTextClass);

            if (!htmlAttributes.ContainsKey("autocomplete"))
            {
                htmlAttributes.Add("autocomplete", "off");
            }

            return(htmlHelper.PasswordFor(expression, htmlAttributes));
        }