I'm trying to post some array of data to controller.. My view is like:
<script>
$.post("/",{
person: [
{ id: 1, name: "a" },
{ id: 2, name: "b" }
]
});
</script>
and in my controller:
[HttpPost]
public ActionResult Index(List<Person> person)
{
//something
}
When I inspect the sent http data, I see that data is:
person[0][id]
person[0][name]
person[1][id]
person[1][name]
but the correct for default model binder is:
person[0].id
person[0].name
person[1].id
person[1].name
How can I fix it?