Demos About Radzen
Search Results for

    Show / Hide Table of Contents

    Password component

    This article demonstrates how to use the Password component.

    Get and set the value

    As all Radzen Blazor input components the Password has a Value property which gets and sets the value of the component. Use @bind-Value to get the user input.

    <RadzenPassword @bind-Value=@user.Password Change=@OnChange />
    @code {
        ApplicationUser user;
    
        protected override async Task OnInitializedAsync()
        {
            user = // get the application user;
        }
    
        void OnChange(string value)
        {
            Console.WriteLine($"Value changed to {value}");
        }
    }
    

    Properties

    Use Disabled, ReadOnly, Placeholder and AutoComplete properties to control various HTML input type="password" attributes. You can set also arbitrary attributes not exposed as properties.

    <RadzenPassword Placeholder="Type here .." MaxLength="10" AutoComplete="false" @oninput=@(args => OnChange(args.Value.ToString())) />
    
    @code {
        void OnChange(string value)
        {
            Console.WriteLine($"Value changed to {value}");
        }
    }
    

    Introducing Radzen Blazor Studio

    Radzen Blazor Studio is a software development environment that empowers developers to design, build and deploy Blazor applications without the traditional hurdles. Write less code and get more done.

    Learn More

    Download Now
    Download Now
    In This Article
    Back to top Radzen Blazor Components, © 2018-2023 Radzen. Source Code licensed under MIT