I followed the instructions of the article http://www.codeproject.com/Tips/850816/Dynamically-Populate-Dependent-Dropdown-List-in-MV for an own project. It works fine. I can dynamically populate dependent dropdownlists in this way.
The code in "5.4 Update Index View" of the article above unifies the ViewModels CityViewModel, StateProvinceViewModel and CountryViewModel. Every ViewModel contains the information for its own dropdownlist.
My question is now:
How can I save the current selections in all three dropdownlists after the selections were made? (I want to save the currently selected values in the dropdownlists in a database). Can someone give me a hint, please?
I know how to handle one ViewModel (maybe with three different DataModels), but I don't know where to start if multiple ViewModels are used.
I use C# and Razor (but I'm also able to read VB and to translate VB into C#). As far as I know, I can only save one ViewModel, or am I wrong?