Dela via


HtmlHelperInputExtensions.Hidden Method

Definition

Overloads

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)

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)

Source:
HtmlHelperInputExtensions.cs
Source:
HtmlHelperInputExtensions.cs
Source:
HtmlHelperInputExtensions.cs

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:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Html::IHtmlContent ^ Hidden(Microsoft::AspNetCore::Mvc::Rendering::IHtmlHelper ^ htmlHelper, System::String ^ expression);
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

The IHtmlHelper instance this method extends.

expression
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.

Applies to

Hidden(IHtmlHelper, String, Object)

Source:
HtmlHelperInputExtensions.cs
Source:
HtmlHelperInputExtensions.cs
Source:
HtmlHelperInputExtensions.cs

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:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Html::IHtmlContent ^ Hidden(Microsoft::AspNetCore::Mvc::Rendering::IHtmlHelper ^ htmlHelper, System::String ^ expression, System::Object ^ value);
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

The IHtmlHelper instance this method extends.

expression
String

Expression name, relative to the current model.

value
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