I am working on an application using ASP.NET MVC 4
. I am trying to send and array of objects to the controller. My view contains:
<input type="hidden" id="1" name="Persons" value='[
{"Id":1,"Name":"Abc","Description":"this is desc"},
{"Id":2,"Name":"def","Description":"this is desc"},
{"Id":4,"Name":"ghi","Description":"this is desc"}]'
/>
And my controller action is like this:
public ActionResult create(List<Person> Persons)
{
//Here the Persons count is always 0, why ?
}
When i post my form, i always get Persons count 0. Can anybody please help me with this issue ?