HtmlHelperInputExtensions.Password Method

Definition

Overloads

Password(IHtmlHelper, String)

Returns an <input> element of type "password" for the specified expression. Does not add a "value" attribute.

Password(IHtmlHelper, String, Object)

Returns an <input> element of type "password" for the specified expression. Adds a "value" attribute containing the value parameter if that is non-null.

Password(IHtmlHelper, String)

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

Returns an <input> element of type "password" for the specified expression. Does not add a "value" attribute.

public static Microsoft.AspNetCore.Html.IHtmlContent Password(this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string expression);

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. Sets <input> element's "value" attribute to string.Empty.

Applies to

Password(IHtmlHelper, String, Object)

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

Returns an <input> element of type "password" for the specified expression. Adds a "value" attribute containing the value parameter if that is non-null.

public static Microsoft.AspNetCore.Html.IHtmlContent Password(this Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper htmlHelper, string expression, object value);

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