I'm curious about binding properties from a ViewModel to another Model.
ViewModel:
In the view, the user can pickup a Department, then the dropdownlist for District populates, and finally the user adds the information of the Store.
Problem: The problem comes when I want to save the properties the user wrote inside the Store model, since the view is constructed using:
and the inputs point to this model.
Relevant info:
This is my view. I access each model from the ViewModel (Department, District, Stores) in order to get each property:
First, I would need to change:
For the ViewModel StoreIndexData.
But then, I'm lost. Maybe if I put a conditional when
And since this will be true, initialize a new Store model with the values that are coming from the Post method, but I don't know how to do this.
Thanks in advance for any help, I hope the problem is clear.
Regards,