Home
PERENDERnew
Theme
Form
Basic components
PDF viewer
chartsnew
Installation
line
File browser
Rich text
Form
InputPassword
InputPassword

1. Demo AstrolInputPassword using EditForm

Note:
In this example, notifications, buttons, labels, and content inputs are implemented. It is recommended to refer to the documentation for each of them.
@using Astrol.Component.Basic.Button
@using Astrol.Component.Basic.Form
@using System.ComponentModel.DataAnnotations
@using Astrol.Entities.Basic.Static.Notification
@using Astrol.Entities.Basic.UI
@using Astrol.JSInterop.Base
@inject AstrolJSInterop jsI
 
<EditForm Model="@login" OnValidSubmit="@HandleValidSubmit">
 <DataAnnotationsValidator />
 <div class="form-control-file">
 <AstrolLabel TItem="Login" For="@nameof(login.Password)" />
 <AstrolContentInput>
 <AstrolInputPassword @bind-Value="@login.Password" Id="@nameof(login.Password)" Class="form-control"/>
 </AstrolContentInput>
 <ValidationMessage For="@(() => login.Password)" />
 </div>
 <AstrolButton Type="ButtonType.Submit" Text="Send" Style="AstrolStyle.Blue" Class="fr" />
</EditForm>
@code {
 public class Login { 
 [Display(Name = "Password")]
 [Required(ErrorMessage = "Password required.")]
 [MinLength(6, ErrorMessage = "Minimum length of 6 characters.")]
 public string Password { get; set; }
 }
 private Login login = new Login();
 private async Task HandleValidSubmit() {
 await jsI.Notification("Sending form".NotificationSucces());
 }
}

Supported parameters

  • Class (string): Custom CSS class you want to set.
  • Id (string): HTML id attribute you want to set.
  • Placeholder (string): Placeholder text to display if desired.
  • ShowPassword (bool): Allows you to set whether the component should hide or show the password (default is true).
  • Autocomplete (bool): Allows you to set whether browser autocomplete should be allowed (default is true).
© 2025 AstrolUI v8.0.4
Se ha producido un error no controlado. Recargar 🗙