Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MSDN Library

HtmlHelper.Password Method (String, Object)

Returns an HTML password control that has the specified name and value.

Namespace:  System.Web.WebPages.Html
Assembly:  System.Web.WebPages (in System.Web.WebPages.dll)

public IHtmlString Password(
	string name,
	Object value


Type: System.String
The value to assign to the name attribute of the HTML control element.
Type: System.Object
The value to assign to the value attribute of the element.

Return Value

Type: IHtmlString
The HTML markup that represents the password control.


name is null or empty.

The returned markup consists of an HTML input element in the following form:

<input type="password" name="name" value="value" />

  • Medium trust for the immediate caller. This member can be used by partially trusted code.
© 2015 Microsoft