This code will help you to understand how to bind and handle events.
You can bind events to DOM elements started with the on<event> with a delegate-type value. The attribute’s name always starts with “on.” In the following code example, the “UpdateHeading” event is triggered when the button is clicked.
<button class="btn btn-primary" @onclick="@UpdateHeading"> Update heading </button>
@code { private void UpdateHeading(MouseEventArgs e) { ... } }
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
You can bind events to DOM elements started with the on<event> with a delegate-type value. The attribute’s name always starts with “on.” In the following code example, the “UpdateHeading” event is triggered when the button is clicked.
need an explanation for this answer? contact us directly to get an explanation for this answer