RadzenLogin Class

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.

Inheritance

Object

ComponentBase

RadzenComponent

RadzenLogin

Implements

IComponent

IHandleEvent

IHandleAfterRender

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

public class RadzenLogin : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRender

Examples

Basic 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>

Constructors

RadzenLoginlink

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.

Declaration
public RadzenLogin()

Properties

AllowRegisterlink

Gets or sets a value indicating whether register is allowed.

Declaration
public bool AllowRegister { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether register is allowed.

AllowRememberMelink

Asks the user whether to remember their credentials. Set to false by default.

Declaration
public bool AllowRememberMe { get; set; }
Property Value
Type Description
boolAsks the user whether to remember their credentials. Set to false by default.

AllowResetPasswordlink

Gets or sets a value indicating whether reset password is allowed.

Declaration
public bool AllowResetPassword { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether reset password is allowed.

AutoCompletelink

Gets or sets a value indicating whether automatic complete of inputs is enabled.

Declaration
public bool AutoComplete { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether automatic complete of inputs is enabled.

FormFieldVariantlink

Gets or sets the design variant of the form field.

Declaration
public Variant? FormFieldVariant { get; set; }
Property Value
Type Description
Variant?Gets or sets the design variant of the form field.

Loginlink

Gets or sets the login callback.

Declaration
public EventCallback<LoginArgs> Login { get; set; }
Property Value
Type Description
EventCallback<LoginArgs>Gets or sets the login callback.

LoginTextlink

Gets or sets the login text.

Declaration
public string LoginText { get; set; }
Property Value
Type Description
stringGets or sets the login text.

Passwordlink

Gets or sets the password.

Declaration
public string Password { get; set; }
Property Value
Type Description
stringGets or sets the password.

PasswordAutoCompleteTypelink

Gets or sets a value indicating the type of built-in autocomplete the browser should use. AutoCompleteType

Declaration
public AutoCompleteType PasswordAutoCompleteType { get; set; }
Property Value
Type Description
AutoCompleteTypeGets or sets a value indicating the type of built-in autocomplete the browser should use. AutoCompleteType

PasswordRequiredlink

Gets or sets the password required.

Declaration
public string PasswordRequired { get; set; }
Property Value
Type Description
stringGets or sets the password required.

PasswordTextlink

Gets or sets the password text.

Declaration
public string PasswordText { get; set; }
Property Value
Type Description
stringGets or sets the password text.

Registerlink

Gets or sets the register callback.

Declaration
public EventCallback Register { get; set; }
Property Value
Type Description
EventCallbackGets or sets the register callback.

RegisterMessageTextlink

Gets or sets the register message text.

Declaration
public string RegisterMessageText { get; set; }
Property Value
Type Description
stringGets or sets the register message text.

RegisterTextlink

Gets or sets the register text.

Declaration
public string RegisterText { get; set; }
Property Value
Type Description
stringGets or sets the register text.

RememberMelink

Sets the initial value of the remember me switch.

Declaration
public bool RememberMe { get; set; }
Property Value
Type Description
boolSets the initial value of the remember me switch.

RememberMeTextlink

Gets or sets the remember me text.

Declaration
public string RememberMeText { get; set; }
Property Value
Type Description
stringGets or sets the remember me text.

ResetPasswordlink

Gets or sets the reset password callback.

Declaration
public EventCallback<string> ResetPassword { get; set; }
Property Value
Type Description
EventCallback<string>Gets or sets the reset password callback.

ResetPasswordTextlink

Gets or sets the reset password text.

Declaration
public string ResetPasswordText { get; set; }
Property Value
Type Description
stringGets or sets the reset password text.

ShowLoginButtonlink

Gets or sets a value indicating whether default login button is shown.

Declaration
public bool ShowLoginButton { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether default login button is shown.

UserNameAutoCompleteTypelink

Gets or sets a value indicating the type of built-in autocomplete the browser should use. AutoCompleteType

Declaration
public AutoCompleteType UserNameAutoCompleteType { get; set; }
Property Value
Type Description
AutoCompleteTypeGets or sets a value indicating the type of built-in autocomplete the browser should use. AutoCompleteType

UserRequiredlink

Gets or sets the user required text.

Declaration
public string UserRequired { get; set; }
Property Value
Type Description
stringGets or sets the user required text.

UserTextlink

Gets or sets the user text.

Declaration
public string UserText { get; set; }
Property Value
Type Description
stringGets or sets the user text.

Usernamelink

Gets or sets the username.

Declaration
public string Username { get; set; }
Property Value
Type Description
stringGets or sets the username.

Methods

BuildRenderTreelink

Declaration
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
Parameters
Type Name Description
Rendering.RenderTreeBuilder __builder

GetComponentCssClasslink

Declaration
protected override string GetComponentCssClass()
Returns
Type Description
string

OnInitializedlink

Declaration
protected override void OnInitialized()

OnLoginlink

Called when login.

Declaration
protected Task OnLogin()
Returns
Type Description
Task

OnRegisterlink

Called when register.

Declaration
protected Task OnRegister()
Returns
Type Description
Task

OnResetlink

Handles the reset event.

Declaration
protected Task OnReset(EventArgs args)
Parameters
Type Name Description
EventArgs args The EventArgs instance containing the event data.
Returns
Type Description
Task

SetParametersAsynclink

Declaration
public override Task SetParametersAsync(ParameterView parameters)
Parameters
Type Name Description
ParameterView parameters
Returns
Type Description
Task
An error has occurred. This app may no longer respond until reloaded. Reload 🗙