예제 #1
0
        public static MvcHtmlString CheckBox(
            this HtmlHelper htmlHelper,
            string name,
            bool isChecked,
            Property property,
            IDictionary <string, object> htmlAttributes)
        {
            var validationAttributes = PropertyUnobtrusiveValidationAttributesGenerator
                                       .GetValidationAttributes(property, htmlHelper.ViewContext);

            htmlAttributes = htmlAttributes.Merge(validationAttributes);

            return(htmlHelper.CheckBox(name, isChecked, htmlAttributes));
        }
예제 #2
0
        public static MvcHtmlString Password(
            this HtmlHelper htmlHelper,
            string name,
            object value,
            Property property,
            IDictionary <string, object> htmlAttributes)
        {
            var validationAttributes = PropertyUnobtrusiveValidationAttributesGenerator
                                       .GetValidationAttributes(property, htmlHelper.ViewContext);

            htmlAttributes = htmlAttributes.Merge(validationAttributes);

            return(htmlHelper.Password(name, value, htmlAttributes));
        }
        public static MvcHtmlString DropDownList(
            this HtmlHelper htmlHelper,
            string name,
            IEnumerable <SelectListItem> selectList,
            Property property,
            IDictionary <string, object> htmlAttributes)
        {
            var validationAttributes = PropertyUnobtrusiveValidationAttributesGenerator
                                       .GetValidationAttributes(property, htmlHelper.ViewContext);

            htmlAttributes = htmlAttributes.Merge(validationAttributes);

            return(htmlHelper.DropDownList(name, selectList, htmlAttributes));
        }