Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4269

bind:after is not firing after selecting an option in Blazor WASM app

$
0
0

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    }}

Viewing all articles
Browse latest Browse all 4269

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>