title: how to Post list using ajax
body: <p>My problem here is how to send the list values to the controller upon an ajax post.  With my actual code, the list is null on post.</p>
  
  <p>My view:   </p>
  
  <pre><code>    @using (Html.BeginForm("UsersList", "Project", FormMethod.Post, new { id = "Users" }))
  {
       &lt;div id="MyList" &gt;
          &lt;table&gt;
          &lt;thead&gt;
          &lt;tr&gt;&lt;th&gt;&lt;/th&gt;&lt;th&gt;User&lt;/th&gt;&lt;th&gt;End date&lt;/th&gt;&lt;/tr&gt;
          &lt;/thead&gt;
  
      @Html.EditorFor(x =&gt; x.GetUsers)
         &lt;/table&gt;
             &lt;/div&gt; 
  
         &lt;script type="text/javascript"&gt;
          $(function () {
              $('#MyList).dialog({
                  autoOpen: false,
                  width: 820,
                  buttons: {
                      "Save": function () {
                          $("#Users").submit();
                      },
  
                      "Cancel": function () {
                          $(this).dialog("close");
                      }
                  }
              });
      &lt;/script&gt;
  </code></pre>
  
  <p>Model:</p>
  
  <pre><code>public class ProjectModel
      {
  
          public List&lt;ProjectList&gt;GetUsers{get;set;}
  
          }
  
    public class ProjectList
      {
          public bool Selected { get; set; }
          public int UserID { get; set; }
  
  }
  </code></pre>
  
  <p>My controller:</p>
  
  <pre><code>[HttpPost]
          public ActionResult UsersList(ProjectModel model)
          {
               return View(model);
          }
  </code></pre>