1
votes

We have to update data to the Model in an action (like save). Our idea: Do not want to make server call often for every time the "focus looses" from the HTML element. Finally we want to update the value while Submit.

<div>
    <label>Name</label>
    <input type="text" value="@student.Name" />
    <br />
    <label>Age</label>
    <input type="text" value="@student.Age" />
    <br />
    <input type="submit" @onclick="Save" />
</div>

@code {
    Student student = new Student();

    private void Save()
    {
        // At this stage - the value should be updated to the model.
    } 
}
1
Use blazor wasm, or a bunch of javascript and JS interoptagua from mars

1 Answers

0
votes

Have you tried updating Visual Studio and .Net Framework Core? Because since I did that it is doing what you asked automatically, saving the data every time an input text loses focus, I don't know why, if it's a bug or a default feature. A video I did showcasing this issue. You can see on the code I did nothing to make this happen.