I'm trying to edit a model that contains a collection of another model as member. I'd like to create a table simulating a grid for editing this collection of items. Then, when submitting the form I want to pass the following parameters to the controller.
public ActionResult SavePerformanceGraphItem(int itemId, ICollection<PerformanceGraphItem> items)
{
}
How should I name the inputs in the view 开发者_如何学运维in order to be retrieved by the controller as I'd like?
the names of the input fields would be something like:
name="items[0].PropertyOne"
name="items[0].PropertyTwo"
...
name="items[1].PropertyOne"
name="items[1].PropertyTwo"
...
name="items[2].PropertyOne"
name="items[2].PropertyTwo"
etc.
精彩评论