From the course: Blazor WebAssembly: Building Your First App

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Data binding

Data binding

- [Instructor] Data binding allows you to automatically bind the value from either a text box or a dropdown list to a property in a Razor component. This can be controlled with an event. The property can be updated as you type or when you're finished typing, and it works the other way around. If you wish to set your property in the code snippet, say, when you click a button, it will automatically update it in the text box or dropdown list. With the application running and going into the product details page, I have the ability to add products to the shopping cart. If I add a quantity of one and go to the shopping cart page, I can see that it's been successfully added. However, if I go back and add three more and go back to the shopping cart page, I can see it's only added one additional item to the cart. It looks like the amount being entered into the quantity box is not binding to the amount that it's being added to the…

Contents