HtmlHelper.Password Method (String, Object, Object)

Returns an HTML password control that has the specified name, value, and custom attributes defined by an attribute object.

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


Public Function Password ( _
    name As String, _
    value As Object, _
    htmlAttributes As Object _
) As IHtmlString
Dim instance As HtmlHelper 
Dim name As String 
Dim value As Object 
Dim htmlAttributes As Object 
Dim returnValue As IHtmlString 

returnValue = instance.Password(name, _
    value, htmlAttributes)
public IHtmlString Password(
    string name,
    Object value,
    Object htmlAttributes
IHtmlString^ Password(
    String^ name, 
    Object^ value, 
    Object^ htmlAttributes
member Password : 
        name:string * 
        value:Object * 
        htmlAttributes:Object -> IHtmlString
public function Password(
    name : String, 
    value : Object, 
    htmlAttributes : Object
) : IHtmlString


  • name
    Type: System.String
    The value to assign to the name attribute of the HTML control element.
  • value
    Type: System.Object
    The value to assign to the value attribute of the element.
  • htmlAttributes
    Type: System.Object
    An object that contains custom attributes for the element. The attribute names and values are retrieved through reflection by examining the properties of the object.

Return Value

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


Exception Condition

name is null reference (Nothing in Visual Basic) or empty.


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

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

See Also


HtmlHelper Class

Password Overload

System.Web.WebPages.Html Namespace