Password Property
Indicates whether the input must be treated as a password and the characters masked on the target device. The default value is false.
public bool Password {
get,
set
}
Remarks
An asterisk is a typical character that is used to mask a password.
Example
The following example demonstrates how to use the Password property to specify that the input is a password.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack
txtUserPwd.Password = true
End If
End Sub
[C#]
void Page_Load(Object sender, EventArgs e)
{
if(!IsPostBack)
{
txtUserPwd.Password = true;
}
}
See Also
Applies to: TextBox Class