Blazor, Blazor Webassembly, Dotnet Core, Net Core.
CheckAnswer(int choice) { if (choice == count) { NextQuestion(); } } } We need to set the @onclick event callback to call the CheckAnswer method when clicked: <div class="row"> @foreach (var choice in choices) { <div class="col-4 text-center border py-3" @onclick="(() => CheckAnswer(choice))">