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.

Event handling

Event handling

- Event handling allows you to perform an action when an event has occurred. This often happens when a button has been clicked. But there are many other instances where event handling can occur such as changing the value in a text box or toggling a check box. It can be set up using a function in the code snippet of a razor component. From there you bind the function to an event within your component. A typical example of event handing is when a form has been submitted. The information that the user has keyed in would have to be stored somewhere. And this is a good example of using event handling. On the product details page, I have a problem. I would try to add an item to the shopping cart. However, when I click on the button it doesn't seem to be working. The quantity is not being reset. If I go into the shopping cart page, I can see that the product has not been added. In order to fix this I need to add event…

Contents