Hi,I need to create a dynamic form using the already existing DB entries, from 3 different tables. I am trying to do this by inheriting ViewModel class, which is comprised of all the model instances (or List of instances of unknown count) within it. When I inherit the ViewModel in the View Template, the dynamic form gets generated without any issues, and looks fine. The dynamic form is generated based on iterating over the calls for each required model instance in the ViewModel passed to the View.Each call uses a partial view of the instance to generate the form, and hence multiple iterations create multiple instances of the form. <% foreach (Option item in Model.Options)
<%: Html.EditorFor( model => item )%>
<% } %> However, when I try to submit the form, the postback does not include the ViewModel object, but rather only the first model instance used in the form.Any suggestions or help would be great!!
View Complete Post