Live Chat Icon For mobile
Live Chat Icon

What is two way data binding in Blazor?

Platform: Blazor| Category: Data binding

Two-way is having a bi-directional data flow, i.e., passing the value from the property to the UI and then from the view (UI) to the property as well The synchronization of data flow between model and view is achieved using the bind attribute in Blazor. Refer to the following code example for two-way data flow.

@page "/"
    
   Enter your name: <input type="text" @bind="@Name" /><br />
    
   <h2>Hello, @Name!</h2>
    
   @code {
      
       private string Name { get; set; } = "Blazor";      
 } 

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.