Skip to main content
Tab

TextBoxPropertiesBase.Password Property

Gets or sets a value that specifies whether the input is treated as a password and all characters entered into the editor are masked.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.2.dll

NuGet Package: DevExpress.Web

Declaration

[DefaultValue(false)]
public virtual bool Password { get; set; }

Property Value

Type Default Description
Boolean false

true if the editor’s characters are masked; otherwise, false.

Remarks

If this property is set to true, all characters entered in the editor are masked and are not saved in view state. A bullet (a filled circle shape) is used to mask the editor’s characters.

Note

The Password property synchronizes its value with the editor’s ASPxTextBoxBase.Password property.

Example

function OnValidationCompleted(s, e) {
    if(e.isValid && Password.GetValue() != ConfirmedPassword.GetValue()) {
        ConfirmedPassword.SetFocus();
        ErrorMessageNotEqual.SetVisible(true);
        e.isValid = false;
    } else
        ErrorMessageNotEqual.SetVisible(false);
}
<script runat="server">
     protected void Page_Load(object sender, EventArgs e) {

     }
     protected void ASPxGlobalEvents1_ValidationCompleted(object sender, 
         DevExpress.Web.ValidationCompletedEventArgs e) {
         lErrorMessageNotEqual.ClientVisible 
            = !tbPassword.Value.Equals(tbConfirmedPassword.Value);
     }
</script>
...
         Type password:<br/>
         <dxe:ASPxTextBox ID="tbPassword" runat="server" Width="170px" 
         ClientInstanceName="Password" Password="True">
         <ValidationSettings SetFocusOnError="true">
             <RequiredField IsRequired="True" />
         </ValidationSettings>
         </dxe:ASPxTextBox>
         <br/>
         Confirm password:
         <dxe:ASPxTextBox ID="tbConfirmedPassword" runat="server" Width="170px" 
          ClientInstanceName="ConfirmedPassword" Password="True">
             <ValidationSettings SetFocusOnError="true">
                 <RequiredField IsRequired="True" />
             </ValidationSettings>
         </dxe:ASPxTextBox>
...
See Also