title: AJAX Post to ASP.NET MVC 6 Controller action method and parameters are null
body: <p>I am having a strange problem with ASP.NET MVC and sending an AJAX post. I have an anchor tag on the page with id 'lnkGetExpirDates'. When the user clicks it I am trying to simply send this hardcoded data to my controller so it can use it as params and return a result back to the page.</p>
  
  <p>However, in the controller the params are always null/default values. Please see my code below and let me know if I am making a silly mistake or something.</p>
  
  <p><strong>Here is my AJAX post:</strong></p>
  
  <pre><code>$("#lnkGetExpirDates").click(function () {
      e.preventDefault();
  
      var data = {
          StartDate: "1/19/2016",
          EndDate: "4/19/2016",
          ProductType: "New",
          Count: 1
      };
  
  
      $.ajax({
          url: '/Products/GetExpirationDates',
          type: 'POST',
          data: JSON.stringify(data),
          contentType: 'application/json; charset=utf-8',
          dataType: 'html',
          success: function (data) {
              $('#ExpirationDates').val(data);
          }
      });
  
  });
  </code></pre>
  
  <p><strong>Here is my controller's action method:</strong></p>
  
  <pre><code>// POST: Product/GetExpirationDates
  [HttpPost]
  //[ValidateAntiForgeryToken]
  public IActionResult GetExpirationDates(GetExpirationDatesViewModel vm)
  {
      // TODO: Get expiration dates and return them in the response
  
      return View();
  }
  </code></pre>
  
  <p><strong>Here is the GetExpirationDatesViewModel:</strong></p>
  
  <pre><code>public DateTime StartDate { get; set; }
  public DateTime EndDate { get; set; }
  public string ProductType { get; set; }
  public int Count { get; set; }
  </code></pre>
  
  <p>Please note that I have even tried this without using a model at all and simply just adding parameters to the Action Method such as startDate, endDate, productType, and Count and still everything comes in as null.</p>