title: MVC How To Pass Array(Guid CustomerIDs) And a Single Value To Controller
body: <p>I am using JavaScript and ajax to pass an array and a single value to the controller, When controller method being call the single value is passed in but not the (array of customerID) and I wonder why, here is the code!</p>
  
  <p>Here is my JavaScript and ajax call:</p>
  
  <pre><code>var arrayOfCustomerID = ['11111111 - 1111 - 1111 - 1111 - 111111111112', '4b732df8-3bbc-4eab-9bf1-da98cc46d527' ,
  '3e74adeb-31a8-4d6f-a66b-a34500c3acc0',' 14897bf4-f5d0-4548-a74d-a34f00ae9cad'];
  
  var version = '3.0';
  
  $.ajax({
           url: '/Updates/UpdateCustomers',
           type: "POST",
           datatype: "json",
           traditional: true,
           data: {
             CustomerIDs: JSON.stringify(arrayOfCustomerID),
             Version: version
                 },
           success: function (data) {
           alert("success");
           }
         });
  </code></pre>
  
  <hr>
  
  <p>Here is my class: </p>
  
  <pre><code>public class SelectedCustomersWithVersion 
      {
          public List&lt;Guid&gt; CustomerIDs { get; set; }
  
          public string version { get; set;  }
      }
  </code></pre>
  
  <hr>
  
  <p>Finally here is my controller method: </p>
  
  <pre><code>[HttpPost]
  public ActionResult UpdateCustomers(SelectedCustomersWithVersion model)
  {
   IList a = model.CustomerIDs.ToList();
   var b = model.version;
   return view();
  }
  </code></pre>
  
  <p>when I put a break point on my controller model I got
   model.CustomerIds: Count = 0, 
   model.Version: "3.0"</p>
  
  <p>I don't know why I am getting Customerids= 0 count, 
   is there something wrong with the code?
   Thanks for help !</p>