$(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>