Blazor: How to use the onchange event in <select> when using @bind also?

后端 未结 6 1591
暖寄归人
暖寄归人 2021-02-12 17:33

I need to be able to run a function after a selection in made in a ...)> @foreach (var option in _options) { } --- public int SelectedId { get; set; }


Some sordid details: I was getting some weird behavior when trying to use F# with server-side Blazor. In short, setting the List of options to the result of an Entity Framework query (mapped to a list of records) wouldn't @bind properly, but using a dummy list of options that were C# classes and not F# records did work. It wasn't due to it being records though, because if I set the list to the EF query and then immediately set it to a dummy list of records, it still didn't @bind properly - but it did work if I commented out the EF line.

提交回复
热议问题