public static IHtmlString Label <TModel>(this HtmlHelpers <TModel> helper, string labelText, string labelFor, IDictionary <string, object> attributes) { if (String.IsNullOrEmpty(labelText)) { throw new ArgumentException("Argument_Cannot_Be_Null_Or_Empty", "labelText"); } labelFor = labelFor ?? labelText; var tag = new TagBuilder("label") { InnerHtml = String.IsNullOrEmpty(labelText) ? String.Empty : HttpUtility.HtmlEncode(labelText) }; if (!String.IsNullOrEmpty(labelFor)) { tag.MergeAttribute("for", labelFor); } tag.MergeAttributes(attributes, false); return(tag.ToHtmlString(TagRenderMode.Normal)); }
public static IHtmlString HiddenFor <TModel, TProperty>(this HtmlHelpers <TModel> helper, Expression <Func <TModel, TProperty> > expression, IDictionary <string, object> htmlAttributes) { return(Hidden(helper, ExpressionHelper.GetExpressionText(expression), expression.Compile()(helper.Model), TypeHelper.ObjectToDictionary(htmlAttributes))); }
public static IHtmlString HiddenFor <TModel, TProperty>(this HtmlHelpers <TModel> helper, Expression <Func <TModel, TProperty> > expression, object htmlAttributes) { return(Hidden(helper, ExpressionHelper.GetExpressionText(expression), expression.Compile()(helper.Model), htmlAttributes)); }
public static IHtmlString TextBox <TModel>(this HtmlHelpers <TModel> helper, string name, object value) { return(TextBox(helper, name, value, null)); }
public static IHtmlString Password <TModel>(this HtmlHelpers <TModel> helper, string name, object value) { return(Password(helper, name, value, null)); }
public static IHtmlString ListBoxFor <TModel, TProperty>(this HtmlHelpers <TModel> helper, Expression <Func <TModel, TProperty> > expression, IEnumerable <SelectListItem> selectList, object selectedValues, int size, bool allowMultiple) { return(ListBox(helper, ExpressionHelper.GetExpressionText(expression), selectList, selectedValues, size, allowMultiple)); }
public static IHtmlString ListBox <TModel>(this HtmlHelpers <TModel> helper, string name, string defaultOption, IEnumerable <SelectListItem> selectList, object selectedValues, object htmlAttributes) { return(ListBox(helper, name, defaultOption, selectList, selectedValues, TypeHelper.ObjectToDictionary(htmlAttributes))); }
public static IHtmlString DropDownListFor <TModel, TProperty>(this HtmlHelpers <TModel> helper, Expression <Func <TModel, TProperty> > expression, string defaultOption, IEnumerable <SelectListItem> selectList, object selectedValue, IDictionary <string, object> htmlAttributes) { return(DropDownList(helper, ExpressionHelper.GetExpressionText(expression), defaultOption, selectList, selectList, htmlAttributes)); }
public static IHtmlString ListBox <TModel>(this HtmlHelpers <TModel> helper, string name, string defaultOption, IEnumerable <SelectListItem> selectList, object htmlAttributes) { return(ListBox(helper, name, defaultOption, selectList, null, htmlAttributes)); }
public static IHtmlString ListBox <TModel>(this HtmlHelpers <TModel> helper, string name, IEnumerable <SelectListItem> selectList, IDictionary <string, object> htmlAttributes) { return(ListBox(helper, name, null, selectList, null, htmlAttributes)); }
public static IHtmlString ListBoxFor <TModel, TProperty>(this HtmlHelpers <TModel> helper, Expression <Func <TModel, TProperty> > expression, IEnumerable <SelectListItem> selectList, IDictionary <string, object> htmlAttributes) { return(ListBox(helper, ExpressionHelper.GetExpressionText(expression), selectList, htmlAttributes)); }
public static IHtmlString DropDownList <TModel>(this HtmlHelpers <TModel> helper, string name, Enum options, Enum currentValue, IDictionary <string, object> htmlAttributes) { var items = currentValue.ToSelectListItems(currentValue).ToList(); return(BuildDropDownList(name, null, items, null, htmlAttributes)); }
public static IHtmlString DropDownList <TModel>(this HtmlHelpers <TModel> helper, string name, Enum options, Enum currentValue, object htmlAttributes) { return(DropDownList(helper, name, options, currentValue, TypeHelper.ObjectToDictionary(htmlAttributes))); }
public static IHtmlString DropDownListFor <TModel, TProperty>(this HtmlHelpers <TModel> helper, Expression <Func <TModel, TProperty> > expression, object htmlAttributes) { return(DropDownListFor(helper, expression, TypeHelper.ObjectToDictionary(htmlAttributes))); }
public static IHtmlString DropDownListFor <TModel>(this HtmlHelpers <TModel> helper, Expression <Func <TModel, Enum> > expression) { return(DropDownListFor(helper, expression, new {})); }
public static IHtmlString Hidden <TModel>(this HtmlHelpers <TModel> helper, string name, object value) { return(Hidden(helper, name, value, null)); }
public static IHtmlString Hidden <TModel>(this HtmlHelpers <TModel> helper, string name, object value, object htmlAttributes) { return(Hidden(helper, name, value, TypeHelper.ObjectToDictionary(htmlAttributes))); }
public static IHtmlString ListBoxFor <TModel, TProperty>(this HtmlHelpers <TModel> helper, Expression <Func <TModel, TProperty> > expression, string defaultOption, IEnumerable <SelectListItem> selectList, object selectedValues, object htmlAttributes) { return(ListBox(helper, ExpressionHelper.GetExpressionText(expression), defaultOption, selectList, selectedValues, htmlAttributes)); }