title: How can we map a c# complex list object from FormData in MVC through Jquery
body: <p>I have a list object in my controller. I need to map this List object with the data which is getting passed to controller in an Ajax call from FormData. The reason why i am using FormData is, i need to get some files from the view in this same ajax call.</p>
  
  <p>Please find my code below</p>
  
  <pre><code> public class AdModel
  {
      public PartsAd PartsAdModel { get; set; }
      public List&lt;HttpPostedFileBase&gt; AdImages { get; set; }
  }
  public class PartsAd
  {
      public List&lt;Vehicle&gt; VehicleList { get; set; }
  }
  public class Vehicle
  {
      public string VehicleBrand { get; set; }
  }
  </code></pre>
  
  <p>Below is my action method in controller</p>
  
  <pre><code> public ActionResult AjaxPostAd(AdModel adModel)
      {
      }
  </code></pre>
  
  <p>Below is my Jquery Code</p>
  
  <pre><code>var applicableVehicleBrands = $('#multiSelectApplicableVehicleBrand option:selected');
      var selectedBrand = 0;
      $(applicableVehicleBrands).each(function () {
          data.append("adModel[PartsAdModel.VehicleList[" + selectedBrand + "].VehicleBrand]", $(this).val())
          selectedBrand = selectedBrand + 1;
      });
   $.ajax({
      cache: false,
      type: "post",
      async: true,
      url: "" + ajaxPostURL + "",
      data: data,
      contentType: false,
      processData: false,
      success: function (data) {});
  </code></pre>
  
  <p>But in my controller, when i look for adModel.PartsAdModel.VehicleList, it is null</p>
  
  <p>Can somebody please help me?</p>