I want to have an InputSelect in a blazor editform that is bound to a model value and also has an onchange event that changes other properties in the model based on the new value.
binding to both @bind-Value and @onchange does not work (im guessing because bind value uses both the value and the value changed properties of the input.
I can bind to oninput, but I would like to know if there is a better way to do this.
<InputSelect id="inputPeriod" name="inputPeriod" class="form-control" @bind-Value="model.Period" @oninput="periodChanged">
protected void periodChanged(ChangeEventArgs e)
{}
I can bind to oninput like this
but ideally I would like to bind to the @onchange event after the model property has been updated, or know what the best practice is for this. without using the bind-value the model validation will not work so the only alternative way I can think of is to have the change events working inside the properties in my model, but that seems wrong