title: my ajax post function keeps failing
body: <p>My script works up to the point of getting the values of the checkboxes the user has selected, but fails when I need to send those values to my action in my controller. There is obviously something wrong with the code for posting but I'm new to ajax and json so I'm not sure what to do.</p>
  
  <pre><code>function getValueUsingClass()
  {
  
      var chkArray = $(".chk:checked").map(function ()
      {
          return this.value;
      }).get(); 
  
  
      if (chkArray.length &gt; 1)
      {
          $.ajax({
              url: "@Url.Action(\"Charter\", \"StateController\")", // My controller name and action name
              contentType: "application/json; charset=utf-8", 
              dataType: "json", 
              type: "POST",
              data: JSON.stringify({ 'randstuff': chkArray }) 
          }).done(function ()
          {
  
          }).fail(function ()
          { 
              alert("Error!");
          });
      } else
      {
          alert("Please check at least one of the checkbox");
      }
  }
  </code></pre>