title: How to resolve null json string passed to mvc controller?
body: <p>I created a table using a list of model objects.
  Then passed the row data to an Ajax post when a button on that row is clicked.</p>
  
  <p>Within the Ajax Post <code>.stringify</code> is called on that row data passed down.
  When I check the values of the data passed on the wire in Dev Tools I can see that they are populated:</p>
  
  <pre><code>["66", "jdoe@gmail.com", "2009", "test",…]
  0
  :
  "66"
  1
  :
  "jdoe@gmail.com"
  2
  :
  "2009"
  3
  :
  "test"
  </code></pre>
  
  <p>But when I step into the controller POST action that is called from client side. The expected JSON string is <strong>null / empty.</strong> My thoughts are that maybe this is beacause stringify has no property names to associate with each value in the array.</p>
  
  <p><strong>Question:</strong></p>
  
  <p>How can you resolve null json string passed to mvc controller?</p>
  
  <p>Here is a gist of the implementation below -</p>
  
  <p>Model:</p>
  
  <pre><code>public class Status
  {
  
          [Key]
          public int ID { get; set; }
  
  
          public string Contact_Email { get; set; }
  
          public string RID { get; set; }
  
          public string Name { get; set; }
  
  
  
      }
  </code></pre>
  
  <p>Table and AJAX post method:</p>
  
  <pre><code>     &lt;table id="statusTable" class="table table-hover table-bordered results"&gt;
              &lt;thead&gt;
                  &lt;tr&gt;
                      &lt;th&gt;ID&lt;/th&gt;
                      &lt;th&gt;Email&lt;/th&gt;
                      &lt;th&gt;RID&lt;/th&gt;
                      &lt;th&gt;Name&lt;/th&gt;
                      &lt;th&gt;Update Record&lt;/th&gt;
  
  
                  &lt;/tr&gt;
              &lt;/thead&gt;
              &lt;tbody&gt;
              @foreach (var row in Model.ReleaseStatus)
              {
                      &lt;tr&gt;
                          &lt;td&gt;@Html.Raw(row.ID)&lt;/td&gt;
                          &lt;td&gt;@Html.Raw(row.Contact_Email_Name)&lt;/td&gt;
                          &lt;td&gt;@row.RID&lt;/td&gt;
                          &lt;td&gt;@row.Name&lt;/td&gt;
                          &lt;td&gt;&lt;button type="submit" class="btn btn-success"&gt;Update&lt;/button&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                }
              &lt;/tbody&gt;
  
          &lt;/table&gt;
  
  
  
   $(".btn-success").click(function () {
              var $td = $(this).closest('tr').children("td"),
              len = $td.length;
              var tableData = $td.map(function (i) {
                  if (i &lt; len - 1)
                      return $(this).text();
              }).get();
  
              console.log(tableData);
  
              //Post JSON data to controller
              $.ajax({
                  type: "POST",
                  url: 'updateStatus',
                  data: JSON.stringify(tableData),
                  contentType: "application/json; charset=utf-8",
                  success: function (response) {
                      console.log("post success");
                  },
                  error: function (request) {
                      console.log("post error" + request.error);
                  }
  
              });
  
  
          });
  </code></pre>
  
  <p>And finally the POST method in the MVC controller:</p>
  
  <pre><code>    [HttpPost]
      public ActionResult updateStatus(stirng jsonString)
      {
          //deserialise the json to a Status object here
      }
  </code></pre>