I created a view component that contains a form with user inputs fields like textbox, dropdown ...etc. I tried to leave a required input field empty when I submitted the form. I got the correct result with error on required field validation and the textbox
field did not render the old value it just return empty with required massage.
also I tried to validate expression on comparing two fields and I got a correct message that two input fields are not the same.
the question is:
How on post and submitting the form the model did not repopulate the old values. even in the component action I am repopulating the data.
does view component preserve user input if model is not valid?
public IViewComponentResult Invoke(NavigationDestination navigationDestination)
{
var model = new IncomeViewModel();
// Code to Build the model
return View(model);
}
Bassam wassouf