A pre-built login form component with username/password fields and optional "Remember Me", "Register", and "Reset Password" features. RadzenLogin provides a ready-to-use authentication UI that can be customized with events for login, registration, and password reset flows. Must be placed inside a RadzenTemplateForm<T>. Eliminates the need to manually create login forms by providing a complete, styled login interface. Features pre-configured text and password inputs, optional switch for persistent sessions (Remember Me), optional link to registration page/modal, optional link for password recovery (Reset Password), browser password manager integration with autocomplete, customizable labels/button text/layout via parameters, Login/Register/ResetPassword event callbacks for implementing auth logic, and built-in required field validation. Handle the Login event to authenticate users with your backend. Use AllowRegister and AllowResetPassword to show/hide those links based on your auth requirements.
IComponent
IHandleEvent
IHandleAfterRender
RadzenComponent.OnAfterRenderAsync
RadzenComponent.RaiseContextMenu
RadzenComponent.RaiseMouseEnter
RadzenComponent.AddContextMenu
RadzenComponent.RaiseMouseLeave
RadzenComponent.OnBecameInvisible
RadzenComponent.DefaultCulture
RadzenComponent.IsJSRuntimeAvailable
ComponentBase.OnInitializedAsync
ComponentBase.OnParametersSet
ComponentBase.OnParametersSetAsync
ComponentBase.StateHasChanged
ComponentBase.ShouldRender
ComponentBase.OnAfterRender
ComponentBase.InvokeAsync
ComponentBase.DispatchExceptionAsync
ComponentBase.RendererInfo
ComponentBase.Assets
ComponentBase.AssignedRenderMode
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
public class RadzenLogin : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRenderBasic login form:
<RadzenTemplateForm Data=@("Login")>
<RadzenLogin Login=@OnLogin />
</RadzenTemplateForm>
@code {
async Task OnLogin(LoginArgs args)
{
// Authenticate with backend
var result = await authService.Login(args.Username, args.Password);
if (result.Success)
NavigationManager.NavigateTo("/dashboard");
}
}
Full-featured login with all options:
<RadzenTemplateForm Data=@("Login")>
<RadzenLogin AllowRegister="true" AllowResetPassword="true"
Login=@OnLogin Register=@OnRegister ResetPassword=@OnResetPassword
UserText="Email" RememberMe="true" />
</RadzenTemplateForm>A pre-built login form component with username/password fields and optional "Remember Me", "Register", and "Reset Password" features. RadzenLogin provides a ready-to-use authentication UI that can be customized with events for login, registration, and password reset flows. Must be placed inside a RadzenTemplateForm<T>. Eliminates the need to manually create login forms by providing a complete, styled login interface. Features pre-configured text and password inputs, optional switch for persistent sessions (Remember Me), optional link to registration page/modal, optional link for password recovery (Reset Password), browser password manager integration with autocomplete, customizable labels/button text/layout via parameters, Login/Register/ResetPassword event callbacks for implementing auth logic, and built-in required field validation. Handle the Login event to authenticate users with your backend. Use AllowRegister and AllowResetPassword to show/hide those links based on your auth requirements.
public RadzenLogin()Gets or sets a value indicating whether register is allowed.
public bool AllowRegister { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether register is allowed. |
Asks the user whether to remember their credentials. Set to false by default.
public bool AllowRememberMe { get; set; }
| Type | Description |
|---|---|
| bool | Asks the user whether to remember their credentials. Set to false by default. |
Gets or sets a value indicating whether reset password is allowed.
public bool AllowResetPassword { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether reset password is allowed. |
Gets or sets a value indicating whether automatic complete of inputs is enabled.
public bool AutoComplete { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether automatic complete of inputs is enabled. |
Gets or sets the design variant of the form field.
public Variant? FormFieldVariant { get; set; }
| Type | Description |
|---|---|
| Variant? | Gets or sets the design variant of the form field. |
Gets or sets the login callback.
public EventCallback<LoginArgs> Login { get; set; }
| Type | Description |
|---|---|
| EventCallback<LoginArgs> | Gets or sets the login callback. |
Gets or sets the login text.
public string LoginText { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the login text. |
Gets or sets the password.
public string Password { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the password. |
Gets or sets a value indicating the type of built-in autocomplete the browser should use. AutoCompleteType
public AutoCompleteType PasswordAutoCompleteType { get; set; }
| Type | Description |
|---|---|
| AutoCompleteType | Gets or sets a value indicating the type of built-in autocomplete the browser should use. AutoCompleteType |
Gets or sets the password required.
public string PasswordRequired { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the password required. |
Gets or sets the password text.
public string PasswordText { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the password text. |
Gets or sets the register callback.
public EventCallback Register { get; set; }
| Type | Description |
|---|---|
| EventCallback | Gets or sets the register callback. |
Gets or sets the register message text.
public string RegisterMessageText { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the register message text. |
Gets or sets the register text.
public string RegisterText { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the register text. |
Sets the initial value of the remember me switch.
public bool RememberMe { get; set; }
| Type | Description |
|---|---|
| bool | Sets the initial value of the remember me switch. |
Gets or sets the remember me text.
public string RememberMeText { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the remember me text. |
Gets or sets the reset password callback.
public EventCallback<string> ResetPassword { get; set; }
| Type | Description |
|---|---|
| EventCallback<string> | Gets or sets the reset password callback. |
Gets or sets the reset password text.
public string ResetPasswordText { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the reset password text. |
Gets or sets a value indicating whether default login button is shown.
public bool ShowLoginButton { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether default login button is shown. |
Gets or sets a value indicating the type of built-in autocomplete the browser should use. AutoCompleteType
public AutoCompleteType UserNameAutoCompleteType { get; set; }
| Type | Description |
|---|---|
| AutoCompleteType | Gets or sets a value indicating the type of built-in autocomplete the browser should use. AutoCompleteType |
Gets or sets the user required text.
public string UserRequired { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the user required text. |
Gets or sets the user text.
public string UserText { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the user text. |
Gets or sets the username.
public string Username { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the username. |
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
| Type | Name | Description |
|---|---|---|
| Rendering.RenderTreeBuilder | __builder |
protected override string GetComponentCssClass()
| Type | Description |
|---|---|
| string |
Called when register.
protected Task OnRegister()
| Type | Description |
|---|---|
| Task |
Handles the reset event.
protected Task OnReset(EventArgs args)
| Type | Name | Description |
|---|---|---|
| EventArgs | args | The EventArgs instance containing the event data. |
| Type | Description |
|---|---|
| Task |
public override Task SetParametersAsync(ParameterView parameters)
| Type | Name | Description |
|---|---|---|
| ParameterView | parameters |
| Type | Description |
|---|---|
| Task |