title: Posting object AJAX to MVC controller results in all properties being null
body: <p>I am trying to post an object from jquery to MVC controller.  The object is passed successfully but all the properties are null (or false for bools).</p>
  
  <p>fwiw, if I JSON.stringify myObect then it does not pass at all, theObect in the controller is null.</p>
  
  <p>I am using MVC4, .net 4.5, jQuery 1.9.1</p>
  
  <p>Any help appreciate.</p>
  
  <p><strong>jQuery function</strong></p>
  
  <pre><code>var myObject =
  {
      Property1: true,
      Proerty2: true
  };
  
  $.ajax({
      type: 'POST',
      url: '/myController/StartProcess/',
      data: { theObject: myObject }
  });
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>private async void StartProcess(myObject theObject)
  {
       // theObect can be seen successfully but property1 and property2 are false
       // if I change them to strings they are null
       ...
  }
  </code></pre>
  
  <p><strong>Class</strong></p>
  
  <pre><code>public class myObject
  {
      public bool Property1 { get; set; }
      public bool Property2 { get; set; }
  }
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The solution was:</p>
  
  <pre><code>$.ajax({
      type: 'POST',
      url: '/myController/StartProcess/',
      data:  myObject
  });
  </code></pre>
  
  <p>If anyone can shed some light as to why this works and nothing else does it would be greatly appreciated.  It is not a great solution because I have to put all my parameters in myObject, I cannot pass any additional parameters using this technique.  also curious as to why all the info I find online, including official tutorials, say to use data: JSON.Strinify(myObect) but for me this causes all the properties of myObject to be null (or false).</p>
  
  <p>Thanks to Roar all the same, at least I can move past this.</p>