/// <summary> /// Generates a textbox with style="display: none" (to work around a weird jQuery _bug) /// </summary> public static MvcHtmlString HiddenFor <TModel, TProperty>(this FormHelper <TModel> helper, Expression <Func <TModel, TProperty> > expression) { return(helper.HtmlHelper.TextBoxFor(expression, new { style = "display: none;" })); }
/// <summary> /// Generates a textbox with style="display: none" (to work around a weird jQuery _bug) /// </summary> public static MvcHtmlString Hidden(this FormHelper helper, string name, object value) { return(helper.HtmlHelper.TextBox(name, value, new { style = "display: none;" })); }
/// <summary> /// Generates hidden form fields for specified GET query parameters. /// </summary> public static HelperResult HiddenForQuery(this FormHelper helper, params string[] except) { return(FilterViewHelper.HiddenForQuery(helper.HtmlHelper, new HashSet <string>(except, StringComparer.OrdinalIgnoreCase))); }
public static MvcHtmlString HiddenReferrer(this FormHelper helper, string action, string controller) { return(helper.HtmlHelper.Hidden(ViewDataKeys.ReturnUrl, helper.HtmlHelper.GetReferrerUrl(action, controller))); }
public static MvcHtmlString HiddenCurrentUrl(this FormHelper helper) { return(helper.HtmlHelper.Hidden(ViewDataKeys.ReturnUrl, helper.HtmlHelper.GetCurrentUrl())); }
/// <summary> /// Creates a readonly field. /// </summary> public static TextBoxBuilder <TModel, TProperty> ReadonlyFor <TModel, TProperty>(this FormHelper <TModel> helper, Expression <Func <TModel, TProperty> > expression) { return(new TextBoxBuilder <TModel, TProperty>(helper.HtmlHelper, expression) .Type(TextBoxType.Readonly)); }
/// <summary> /// Creates a text area. /// </summary> public static TextAreaBuilder <TModel, TProperty> TextAreaFor <TModel, TProperty>(this FormHelper <TModel> helper, Expression <Func <TModel, TProperty> > expression) { return(new TextAreaBuilder <TModel, TProperty>(helper.HtmlHelper, expression)); }