Angular function to get list of products using pages getting input from user.
$scope.GetProductList = function () { $scope.requestPage = 1; // use $.param jQuery function to serialize data from JSON var data = $.param({ Page: $scope.requestPage, CategoryId: $scope.categoryId }); var config = { headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;' } } var test = $http.post('/Home/GetProductList', data, config) .success(function (result) { $scope.productList = result.Products; }).error(function (data) { console.log(data) }); }
Add Asp.Net MVC controller method to get product object and second param as requested page.
public JsonResult GetProductList(MyModel.Product prodObj, int page) { // to do }
Happy Coding!