You can use EditorTemplates to handle this situation.
Let's make a new viewmodel for our view.
public class PropListVM
{
public List<PropModel> Props { set; get; }
public PropListVM()
{
Props = new List<PropModel>();
}
}
Now in our GET Action, we will create an object of this new viewmodel, Set the Props collection and send to our view.
public ActionResult Index()
{
var vm = new PropListVM { Props = GetPropsFromSomeWhere() };
return View(vm);
}
private List<PropModel> GetPropsFromSomeWhere()
{
var list = new List<PropModel>();
//Hard coded for demo. You may replace it with DB items
list.Add(new PropModel { Name = "Detroit", Value = "123" });
list.Add(new PropModel { Name = "Ann Arbor", Value = "345" });
return list;
}
Now Let's create an EditorTemplates. Go to ~/Views/YourControllerName and Create a Folder called "EditorTemplates" and create a new view there with the same name as of the Property Name(PropModel.cshtml)

Add this code to your new editor template.
@model ReplaceYourNameSpaceHere.PropModel
<div>
Name :@Html.TextBoxFor(s=>s.Name) <br />
Value : @Html.TextBoxFor(s=>s.Value)
</div>
Make sure to replace ReplaceYourNameSpaceHere with your actual namespace where the PropModel class is available.
Now Let's go back to our original view(Index.cshtml) which is strongly typed to an instance of our PropListVM viewmodel.
@model ReplaceYourNameSpaceHere.PropListVM
@using (Html.BeginForm())
{
<div>
@Html.EditorFor(s=>s.Props)
<input type="submit" value="submit"/>
</div>
}
Now let's have an action method to handle the form posting, You will have a parameter of type PropListVM and MVC model binding will bind the properties of this objects from the form posted. You can check the Props property of this object and loop through each items.
[HttpPost]
public ActionResult Index(PropListVM model)
{
foreach (var prop in model.Props)
{
string s = prop.Name;
//Do cool somethings
}
// return or redirect now
//If we are returning the posted model back to the form,
//reload the Props property.
model.Props = GetPropsFromSomeWhere();
return View(model);
}
And the result is ??? Profit !!!!!!
In my example, I sent 2 PropModel items with Name and Value properties set, But if you want some empty form, Simply add PropModel objects without initializing any property values.
