title: how to post simple ID (jquery ajax) to Action method in asp.net mvc
body: <p>I have an category drop down list that i write blow code in it's onchange event:</p>
  
  <pre><code>function onChange() {
  $.ajax(
  {
  url: '/Home/GetProducts/',
  type: 'POST',
  data: JSON.stringify({ID:$("#Category").val()}),
  //contentType:"application/json; charset=utf-8",
  dataType: "json",
  success: function (data){
  var jsonres = "";
  $.each(data, function (i, variant) {
  jsonres += '&amp;lt;option value="' + variant.ID + '"&gt;' + variant.Name+ '&amp;lt;/option&gt;';
  });
  $("#product").html(jsonres);
  }
  , error: function () { alert('Error'); }
  });
  }
  </code></pre>
  
  <p>and my Action method is :</p>
  
  <pre><code>[HttpPost]
  public ActionResult GetProducts(int? ID)
  {
          var res = _teacherUow.GetProducts(ID.GetValueOrDefault()).Select(x =&gt; new { x.ID, x.Name }).ToList();
          return Json(new { Result = true, data = res }, JsonRequestBehavior.AllowGet);
  }
  </code></pre>
  
  <p>my view code:</p>
  
  <pre><code>@Html.DropDownList("Category", new SelectList(ViewBag.Category, "ID", "Name"), new {  id = "Category", onchange = "onChange()" })
          &amp;lt;select data-val="true" id="product" name="product"&gt;
          &amp;lt;/select&gt;
  </code></pre>
  
  <p>Now i have three problem</p>
  
  <p>1-in the action method parameter receive null</p>
  
  <p>the json result is :</p>
  
  <pre><code>{"Result":true,"data":[{"ID":1,"Name":"xxx"},{"ID":3,"Name":"yyyy"}]}
  </code></pre>
  
  <p>2- but the value and text of product drop down list member
  is 'undefined'</p>
  
  <p>3- create empty dropdown list for product field with html helper(for fill data member by Ajax request)
  can anyone please help me?</p>