title: Post a json object to mvc controller with jquery and ajax
body: <p>I am trying to submit some values from a form to my mvc controller.</p>
  
  <p>Here is my controller:</p>
  
  <pre><code> //Post/ Roles/AddUser
      [HttpPost]       
      public ActionResult AddUser(String json)
      {
          Log.submit(json);            
          return View();
      }
  </code></pre>
  
  <p>here is the js:</p>
  
  <pre><code>&lt;script&gt;
  function submitForm() {
  
      var usersRoles = new Array;
      $("#dualSelectRoles2 option").each(function () {
          usersRoles.push($(this).val());
      });
      console.log(usersRoles);
  
      jQuery.ajax({
          type: 'POST',
          url: "@Url.Action("AddUser")",
          contentType: "application/json; charset=utf-8",
          datatype: 'json',
          data: JSON.stringify(usersRoles),
          success: function (data) { alert(data); },
          failure: function (errMsg) {
              alert(errMsg);
          }
      });
  }
  </code></pre>
  
  <p></p>
  
  <p>When I debug on the controller I get my parameter to be null?
  The <code>console.log(usersRoles)</code> gives me data.</p>
  
  <p>What am I doing incorrectly?</p>
  
  <p>How can I receive a json object in the controller?</p>