sry for my bad english
I want to create list of data something like below:
<div>
<input type="text" name="Users[0][FirstName]">
<input type="text" name="Users[0][LastName]">
</div>
<div>
<input type="text" name="Users[1][FirstName]">
<input type="text" name="Users[1][LastName]">
</div>
.
.
.
But the inputs will create dynamically and when admin pushes the delete button of a div the index of Users (Users[index][FirstName]) will be disordered. Because of this I set a counter that never decreases but the problem is when I post Data sometimes it will be like this:
<div>
<input type="text" name="Users[0][FirstName]">
<input type="text" name="Users[0][LastName]">
</div>
<div>
<input type="text" name="Users[2][FirstName]">
<input type="text" name="Users[2][LastName]">
</div>
and in server side C# (list) gets data until the last index that exist and other index after that will be null. I have seen this scenario in opencart website for attributes in products and it has counter like me and send the data like my code but its handle the list. Is this a problem of model binder? How I can fix that?