Collection always null when using [FromForm] attribute
For test I used the following arrayOfContent
:
var arrayOfContent = [];
arrayOfContent.push({ name: 'test', link: 'test.com' });
arrayOfContent.push({ name: 'test2', link: 'test2.com' });
And I used a for loop to append the array to the form data:
for (var i = 0; i < arrayOfContent.length; i++) {
formData.append("Contents[" + i + "].Name", arrayOfContent[i].name);
formData.append("Contents[" + i + "].Link", arrayOfContent[i].link);
}
And I in Visual Studio I can see that it can bind it: