In Blazor, all native events are bound to async task. You can bind the button click event with async task handler. In the following example, the button click event bound to async method.
<button @onclick="@onClick"> Click </button>
@code {
private async Task onClick()
{
await service.GetItems();
}
}
Share with