ASP.NET MVC从视图传递多个模型到Controller

$(function() {
        $("#go").click(function() {
            var models = [];
            $.each($("table tr"), function(i, item) {
                var ProductName = $(item).find("[name=ProductName]").val();
                var SupplierID = $(item).find("[name=SupplierID]").val();
                var CategoryID = $(item).find("[name=CategoryID]").val();
                models.push({ ProductName: ProductName, SupplierID: SupplierID, CategoryID: CategoryID });
            });
 
            $.ajax({
                url: '../../Home/ReceiveData',
                data: JSON.stringify(models),
                type: 'POST',
                contentType: 'application/json; charset=utf-8',
                success: function(msg) {
                    alert(msg);
                }
            });
        });
    })
</script>
原文地址:https://www.cnblogs.com/Jerrycjc/p/5151446.html