Html.EditorFor(m => m[i].Id) will display the Id value of Model[i].Id. If your models have duplicate Ids, so will your form.
–
jrummellFeb 13 '12 at 18:06

@jrummell: Yes using that my form's elements will have duplicate Ids. But then how would client validation work?
–
MoonFeb 13 '12 at 19:28

Well, to start, you should make sure you have unique ids. Other than that, do you have a specific error?
–
jrummellFeb 13 '12 at 19:30

@jrummell: I am not talking about the actual BookID. I am talking about the HTML element id. For example, there will be more than one textbox with id="CheckInDate" in the form. One for each book in the collection.
–
MoonFeb 13 '12 at 20:08

2

If your model is an IList<T>, and you create inputs with Html.EditorFor(m => m[i].Id), the element ids will be _0_CheckInDate, _1_CheckInDate, etc. Try it, and you'll see...
–
jrummellFeb 13 '12 at 20:13