I have a form in View where are multiple fields. I send them to controller and I want to bind them to List. How can I achieve this?
For now i have this code
View
using (Html.BeginForm("GetVendorInvoice", "Sale", FormMethod.Get))
{
foreach (var invoice in Model.VendorInvoices)
{
@Html.Hidden("invoiceId", invoice.InvoiceId)
}
<input type="submit" value="Wszystkie na raz"/>
}
Controller:
public ActionResult GetVendorInvoice(List<string> invoiceIdList) {
...}
I read some article that said it shoud work but actually it does not. Any sugestions?