I have a simple select
in my Blazor WASM Standalone app (targeting .NET 9) and I want to perform some action after user selects an option. I understand for async
calls, Microsoft now recommends using bind:after
.
I'm following this video and doing exactly what he does in his tutorial but in my case I don't hit the break point I place in DoSomething()
method in my code. What am I doing wrong here?
<div><select @bind="SelectedState" @bind:after="DoSomething"><option value="">Please select one</option><option value="AK">Alaska</option><option value="MT">Montana</option><option value="WY">Wyoming</option></select></div>@code { private string SelectedState; private async Task DoSomething() { var userSelected = SelectedState; // Have a break point here but don't hit it }}