HtmlHelperInputExtensions.Hidden HtmlHelperInputExtensions.Hidden HtmlHelperInputExtensions.Hidden Method

Definition

Overloads

Hidden(IHtmlHelper, String) Hidden(IHtmlHelper, String) Hidden(IHtmlHelper, String)

Returns an <input> element of type "hidden" for the specified expression. Adds a "value" attribute to the element containing the first non-null value found in: the ModelState entry with full name, the ViewData entry with full name, or the expression evaluated against Model. See Name(String) for more information about a "full name".

Hidden(IHtmlHelper, String, Object) Hidden(IHtmlHelper, String, Object) Hidden(IHtmlHelper, String, Object)

Returns an <input> element of type "hidden" for the specified expression. Adds a "value" attribute to the element containing the first non-null value found in: the ModelState entry with full name, the value parameter, the ViewData entry with full name, or the expression evaluated against Model. See Name(String) for more information about a "full name".

Hidden(IHtmlHelper, String) Hidden(IHtmlHelper, String) Hidden(IHtmlHelper, String)

Returns an <input> element of type "hidden" for the specified expression. Adds a "value" attribute to the element containing the first non-null value found in: the ModelState entry with full name, the ViewData entry with full name, or the expression evaluated against Model. See Name(String) for more information about a "full name".

public static Microsoft.AspNetCore.Html.IHtmlContent Hidden (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string expression);
static member Hidden : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper * string -> Microsoft.AspNetCore.Html.IHtmlContent
<Extension()>
Public Function Hidden (htmlHelper As IHtmlHelper, expression As String) As IHtmlContent

Parameters

htmlHelper
IHtmlHelper IHtmlHelper IHtmlHelper

The IHtmlHelper instance this method extends.

expression
String String String

Expression name, relative to the current model.

Returns

A new IHtmlContent containing the <input> element.

Remarks

Combines HtmlFieldPrefix and expression to set <input> element's "name" attribute. Sanitizes expression to set element's "id" attribute.

Hidden(IHtmlHelper, String, Object) Hidden(IHtmlHelper, String, Object) Hidden(IHtmlHelper, String, Object)

Returns an <input> element of type "hidden" for the specified expression. Adds a "value" attribute to the element containing the first non-null value found in: the ModelState entry with full name, the value parameter, the ViewData entry with full name, or the expression evaluated against Model. See Name(String) for more information about a "full name".

public static Microsoft.AspNetCore.Html.IHtmlContent Hidden (this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string expression, object value);
static member Hidden : Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper * string * obj -> Microsoft.AspNetCore.Html.IHtmlContent
<Extension()>
Public Function Hidden (htmlHelper As IHtmlHelper, expression As String, value As Object) As IHtmlContent

Parameters

htmlHelper
IHtmlHelper IHtmlHelper IHtmlHelper

The IHtmlHelper instance this method extends.

expression
String String String

Expression name, relative to the current model.

value
Object Object Object

If non-null, value to include in the element.

Returns

A new IHtmlContent containing the <input> element.

Remarks

Combines HtmlFieldPrefix and expression to set <input> element's "name" attribute. Sanitizes expression to set element's "id" attribute.

Applies to