In Scotts blog post he describes how to post an array of objects to the controller.
My Question how best to generate a View for this that allows th
You may see This In this post steve Validated a variable length list in which textboxes may be added or deleted dynamically
when rendering and binding to lists or arrays, i normally prefer for loop over foreach loop because it will generate required indices for the modelbinder to bind data to the model.
for(int i=0;i<Model.Count(); i++)
{
<%:Html.TextBox("Items["+i+"].Name", Model[i].Name)%>
}
i m not comfortable with strongly typed helpers when it comes to list binding but its purely a matter of personal preference. However, if you are allowing the user to dynamically add and remove items from page through javascript you have to take care of indices yourself.
EDIT: i have blogged about creating master detail form in asp.net mvc using jquery templates which is relevant in list binding scenario as well