title: how to accept value passed through ajax
body: <p>I wrote a code to pass id's of those records which are selected by user by clicking checkbox</p>
  
  <p>on click of bttn submit following code is called</p>
  
  <pre><code>  $("#button").click(function () {
  
   var selected = $(".a:checked").map(function() {
      return this.id;
  }).get();
  
  var urlDistricts = '@Url.Action("selectedId")';
  $.ajax({
      type: "POST",
  
      url: urlDistricts,
      data: { listofid:selected },
      success: function () {
  
      }
  });
  });
  </code></pre>
  
  <p>and to catch this i wrote following in my controller</p>
  
  <pre><code>    [HttpPost]
      public ActionResult selectedId(List&lt;int&gt; listofid)
      {
          return View();
      }
  </code></pre>
  
  <p>but the <strong>listofid</strong> is cuming null</p>