Dela via


IHtmlHelper.Hidden(String, Object, Object) Method

Definition

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, the expression evaluated against Model, or the htmlAttributes dictionary entry with key "value". See Name(String) for more information about a "full name".

public:
 Microsoft::AspNetCore::Html::IHtmlContent ^ Hidden(System::String ^ expression, System::Object ^ value, System::Object ^ htmlAttributes);
public Microsoft.AspNetCore.Html.IHtmlContent Hidden (string expression, object value, object htmlAttributes);
abstract member Hidden : string * obj * obj -> Microsoft.AspNetCore.Html.IHtmlContent
Public Function Hidden (expression As String, value As Object, htmlAttributes As Object) As IHtmlContent

Parameters

expression
String

Expression name, relative to the current model.

value
Object

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

htmlAttributes
Object

An Object that contains the HTML attributes for the element. Alternatively, an IDictionary<TKey,TValue> instance containing the HTML attributes.

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