Class RadzenPassword
A password input component that masks entered characters for secure password entry with autocomplete support. RadzenPassword provides a styled password field with browser autocomplete integration for password managers. Displays entered characters as dots or asterisks to protect sensitive data from shoulder surfing, integrates with browser password managers by setting appropriate autocomplete attributes. Supports data binding, validation, placeholder text, and read-only mode for display purposes. Use within forms for login, registration, password change, or any scenario requiring secure text entry.
Inheritance
Inherited Members
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
Syntax
public class RadzenPassword : FormComponentWithAutoComplete<string>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable, IRadzenFormComponent
Examples
Basic password input:
<RadzenPassword @bind-Value=@password Placeholder="Enter password" />
Password confirmation with validation:
<RadzenTemplateForm Data=@model>
<RadzenPassword Name="Password" @bind-Value=@model.Password Placeholder="Password" />
<RadzenRequiredValidator Component="Password" Text="Password is required" />
<RadzenPassword Name="ConfirmPassword" @bind-Value=@model.ConfirmPassword Placeholder="Confirm password" />
<RadzenCompareValidator Value=@model.Password Component="ConfirmPassword" Text="Passwords must match" />
</RadzenTemplateForm>
Constructors
RadzenPassword()
A password input component that masks entered characters for secure password entry with autocomplete support. RadzenPassword provides a styled password field with browser autocomplete integration for password managers. Displays entered characters as dots or asterisks to protect sensitive data from shoulder surfing, integrates with browser password managers by setting appropriate autocomplete attributes. Supports data binding, validation, placeholder text, and read-only mode for display purposes. Use within forms for login, registration, password change, or any scenario requiring secure text entry.
Declaration
public RadzenPassword()
Examples
Basic password input:
<RadzenPassword @bind-Value=@password Placeholder="Enter password" />
Password confirmation with validation:
<RadzenTemplateForm Data=@model>
<RadzenPassword Name="Password" @bind-Value=@model.Password Placeholder="Password" />
<RadzenRequiredValidator Component="Password" Text="Password is required" />
<RadzenPassword Name="ConfirmPassword" @bind-Value=@model.ConfirmPassword Placeholder="Confirm password" />
<RadzenCompareValidator Value=@model.Password Component="ConfirmPassword" Text="Passwords must match" />
</RadzenTemplateForm>
Properties
DefaultAutoCompleteAttribute
Gets or sets the default autocomplete attribute's string value.
Declaration
public override string DefaultAutoCompleteAttribute { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
Immediate
Gets or sets whether the component should update the bound value immediately as the user types (oninput event), rather than waiting for the input to lose focus (onchange event). This enables real-time value updates but may trigger more frequent change events.
Declaration
[Parameter]
public bool Immediate { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
ReadOnly
Gets or sets whether the password input is read-only and cannot be edited. When true, displays the masked value (or placeholder) but prevents user input. Useful for displaying password field in view-only forms, though typically passwords are not displayed at all.
Declaration
[Parameter]
public bool ReadOnly { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
Methods
BuildRenderTree(RenderTreeBuilder)
A password input component that masks entered characters for secure password entry with autocomplete support. RadzenPassword provides a styled password field with browser autocomplete integration for password managers. Displays entered characters as dots or asterisks to protect sensitive data from shoulder surfing, integrates with browser password managers by setting appropriate autocomplete attributes. Supports data binding, validation, placeholder text, and read-only mode for display purposes. Use within forms for login, registration, password change, or any scenario requiring secure text entry.
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderTreeBuilder | __builder |
Overrides
GetComponentCssClass()
Gets the component CSS class.
Declaration
protected override string GetComponentCssClass()
Returns
| Type | Description |
|---|---|
| string |
Overrides
GetId()
Gets the unique identifier.
Declaration
protected override string GetId()
Returns
| Type | Description |
|---|---|
| string | Returns the |
Overrides
OnChange(ChangeEventArgs)
Handles the Change event.
Declaration
protected Task OnChange(ChangeEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ChangeEventArgs | args | The ChangeEventArgs instance containing the event data. |
Returns
| Type | Description |
|---|---|
| Task |