title: ASP.NET MVC Jquery Ajax post form serialize?
body: <p>Ajax function</p>
  
  <pre><code>$(function () {
      $('form').submit(function () {
          if ($(this).valid()) {
              $.ajax({
                  url: this.action,
                  type: this.method,
                  data: { model: $(this).serialize(), locations: getCheckedLocation(), reports: getCheckedReports() },
                  beforeSend: function () {
  
                  },
                  complete: function () {
  
                  },
                  success: function (result) {
                      $('#user_operations_container').html(result);
                      setTimeout(function () { LoadAction('@Url.Action("GetAllUsers", "User")') }, 1000);
                      $("#widgets ul li a").removeClass("link_active");
                      $("#widgets ul li:first-child a").addClass("link_active");
                  }
              });
          }
          return false;
      });
  });
  </code></pre>
  
  <p>functions that are using in ajax data attribute</p>
  
  <pre><code>function getCheckedLocation() {
      var nodes = $('#tt_location').tree('getChecked');
      var s = '';
      for (var i = 0; i &lt; nodes.length; i++) {
          if (s != '') s += ',';
          s += nodes[i].text;
      }
      return s;
  }
  
  function getCheckedReports() {
      var nodes = $('#tt_reports').tree('getChecked');
      var s = '';
      for (var i = 0; i &lt; nodes.length; i++) {
          if (s != '') s += ',';
          s += nodes[i].text;
      }
  
      return s;
  }  
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;div&gt; // there are html helpers for model (dropdownlistfor, textboxfor,...)
  &lt;/div&gt;
  &lt;div&gt; // checkbox tree (#tt_location)
  &lt;/div&gt;
  &lt;div&gt; // checkbox tree (#tt_reports)
  &lt;/div&gt;
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>[HttpPost]
  public ActionResult _EditUser(UserViewModel model,string locations,string reports)
  {
      // model = null
      // locations and reports are expected. (not null)
  }
  </code></pre>
  
  <p>Question</p>
  
  <p>Why model is null? 
  When I use ajax data attribute like this = <code>data: $(this).serialize(),</code> , It works model is not null.</p>
  
  <p>How can I post model, with additional data (locations,reports).</p>
  
  <p>I hope I can explain. Thanks...</p>