title: MVC Model binding JSON
body: <p>I have a JS file that creates a JSON string that I stringify and post with AJAX call to the server, using Fiddler I can see the JSON is formatted correctly and my Action is called as it stops at the breakpoint but my Model has just Nulls.</p>
  
  <p>Here is the JS code:</p>
  
  <pre><code>    var testString = { id: "1", date: "28/04/2013", sim: "B787", times: "0100", note: "Test note" };
  
      $.ajax({
          url: url,
          type: 'POST',
          contentType: 'application/json',
          data: JSON.stringify(testString),
          success: function (data) {
          },
          error: function (request, status, error) {
          }
      });
  </code></pre>
  
  <p>And here is the Model:</p>
  
  <pre><code>[Serializable]
    public class BookingModel
    {
      public int Id { get; set; }
      public DateTime Date { get; set; }
      public string Sim { get; set; }
      public string Times { get; set; }
      public string Note { get; set; }
    }
  </code></pre>
  
  <p>Finally here is the Action that is called.</p>
  
  <pre><code>    [HttpPost]
      //[ValidateAntiForgeryToken]
      public ActionResult Booking(BookingModel BookingModel)
      {
  
          return Json(new { sucess = 0});
      }
  </code></pre>
  
  <p>And during debug the BookingModel shows nothing but NULL's but as I mention abouve FIddler is showing the string as:</p>
  
  <pre><code>{"id":"1","date":"28/04/2013","sim":"B787","times":"0100","note":"Test note"}
  </code></pre>
  
  <p>I have been at this for 2 days now and I'm getting bald someone please help... It's driving me nuts.</p>
  
  <p>Thanks.</p>
  
  <p>Cliff.</p>
  
  <p><em><strong>EDIT</em>*</strong></p>
  
  <p>Ok bit more info looks like it does work but what I have to do is on the first breakpoint if I hit F5 to continue to the action is called again and this time the data is present and correct.</p>
  
  <p>So my question now is as it works on the second round trip to the server whay not on the first?</p>
  
  <p>Thanks</p>
  
  <p>Cliff.</p>