I have made changes below to the question, which is still the same but hopefully a lot clearer through the models and in regards to what I want to achieve and where I\'ve co
Treat the views as independent. If your partial view was a full view, you would pass it a IEnumerable
so render with:
@Html.Partial("ClassBView", Model.ClassB)
Also, you can't use foreach with EditorFor as there is insufficient information to create a name based on the index. Use a normal for loop instead. The expression parser can then convert it to name="name[1]" etc as the index is available in the expression:
@model IEnumerable
@if(Model != null)
{
for (int i = 0; i < Model.Count; i++)
{
@Html.EditorFor(modelItem => Model[i].Name)
}
}
There is more missing from your example (what Clear and Create connect to for instance), so if you can provide the rest of your controller code I will expand this.