title: Jquery serialize : trying to pass a form status to an ASP.NET MVC controller without submitting the form
body: <p>Working on an ASP.NET MVC application.
  A form has several buttons submitting the form.
  One of the buttons needs to send to the controller the form's controls status without submitting the form.
  I plan to use Ajax and $('#FormID').serialize();</p>
  
  <p>I wrote it this way:</p>
  
  <pre><code>  function rechercher() {
          var formStatus = $('#FormID').serialize();
  
          var url = '@Url.Action("Search", "ImproItemForm"); //?'+ formStatus;
          // alert('formStatus: ' + formStatus); //works fine
           alert('url: ' + url);
  
          $.ajax({
              url: url,
              type: 'POST',
              dataType: 'json',
              data:/* { improItem: formStatus },*/  formStatus ,
              contentType: "application/json; charset=utf-8", 
              success: function (result) {
                     alert("success" + result);
              },
              error: function (result) {
                     alert("failure" + result);
              }
          });
      }
  </code></pre>
  
  <p>My controller action is as below:</p>
  
  <pre><code>public ActionResult Search(FormCollection improItem)
  {
  }
  </code></pre>
  
  <p>If I call ajax this way, it never reaches the controller (and thus triggers the error function.</p>
  
  <p>If I comment this line: </p>
  
  <pre><code>data: formStatus ,
  </code></pre>
  
  <p>Then it does invoke the controller method but the FormCollection improItem argument has no values of course.
  So I suppose that I am not passing the data correctly to Ajax but I do not manage to get this sorted.</p>
  
  <p>thx in advance.</p>