[HttpPost]
public ActionResult PrintBarcode( List< Models.test > cmd)
{
...
}
class Test{
public long ProductId { get; set; }
public int Quantity { get; set; }
}
Post時候參數如果透過JQuery,則可以直接把form給序列化: $('#formId').serialize()
Reference:http://kristofmattei.be/2009/10/19/asp-net-mvc-model-binding-to-a-list/http://blog.gfader.com/2010/05/aspnet-mvc-model-binding-to-list-or-how.html
沒有留言:
張貼留言