Ejemplo n.º 1
0
 /// <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;" }));
 }
Ejemplo n.º 2
0
 /// <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;" }));
 }
Ejemplo n.º 3
0
 /// <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)));
 }
Ejemplo n.º 4
0
 public static MvcHtmlString HiddenReferrer(this FormHelper helper, string action, string controller)
 {
     return(helper.HtmlHelper.Hidden(ViewDataKeys.ReturnUrl, helper.HtmlHelper.GetReferrerUrl(action, controller)));
 }
Ejemplo n.º 5
0
 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));
 }