title: Posting JSON objects into MVC Controller C#
body: <p>JS File</p>
  
  <pre><code>var module = angular.module('myApp', []);
  
  module.controller('myController', function ($scope, $http) {
      $scope.items = [{}];
      $scope.users = {};
      $scope.addfield = function () {
          $scope.items.push({});
      }
      $scope.saveUser = function () {
          $scope.results = [];
          console.log($scope.users);
  
          $http({
              method: 'POST',
              url: '/Data/MethodTest',
  
              data:{
                  users: $scope.users
              }
  
          }).success(function (data) {
              console.log(data)
          });
  
      }
  
  });
  </code></pre>
  
  <p>HTML Code</p>
  
  <pre><code>&lt;body data-ng-app="myApp" data-ng-controller="myController"&gt;
      &lt;form name="educdetailsform" novalidate&gt;
          &lt;label&gt;Education Details&lt;/label&gt;&lt;/br&gt;
          &lt;button ng-click="addfield()"&gt;Add Education&lt;/button&gt;
          &lt;div ng-repeat="item in items track by $index"&gt;
              &lt;input type="text" name="empData.qualification[]" placeholder="Qualification" ng-model="users[$index].qualification"&gt;
              &lt;input type="text" name="empData.year[]" placeholder="Year of Passing" ng-model="users[$index].year"&gt;
              &lt;input type="text" name="empData.percentage[]" placeholder="Percentage" ng-model="users[$index].percentage"&gt;
          &lt;/div&gt;
          &lt;input type="submit" name="submit" ng-click="saveUser()" /&gt;
      &lt;/form&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>.cs Code //
   I'm trying to insert values of the object fetched into database. Before which I've just written code to deserialise the objects. as of now I'm getting just null values passed from the JS//</p>
  
  <pre><code> public JsonResult MethodTest(string jsonData)
           {
               string jdata = jsonData.ToString();
               List&lt;StockAllocate&gt; stockData;
               bool status = false;
  
  
                  JavaScriptSerializer jss = new JavaScriptSerializer();
                  stockData = jss.Deserialize&lt;List&lt;StockAllocate&gt;&gt;(jdata);
                   status = true;
  
  
               return new JsonResult { Data = new { status = status } };
           }
  </code></pre>