コード例 #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;" }));
 }
コード例 #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;" }));
 }
コード例 #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)));
 }
コード例 #4
0
 public static MvcHtmlString HiddenReferrer(this FormHelper helper, string action, string controller)
 {
     return(helper.HtmlHelper.Hidden(ViewDataKeys.ReturnUrl, helper.HtmlHelper.GetReferrerUrl(action, controller)));
 }
コード例 #5
0
 public static MvcHtmlString HiddenCurrentUrl(this FormHelper helper)
 {
     return(helper.HtmlHelper.Hidden(ViewDataKeys.ReturnUrl, helper.HtmlHelper.GetCurrentUrl()));
 }
コード例 #6
0
 /// <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));
 }
コード例 #7
0
 /// <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));
 }