title: Ajax returning null value / asp.net
body: <p>I am trying to get multiple entiries with Ajax. However, both &quot;id&quot; and &quot;qty&quot; return null (By the way, I gave default values for them now.). Can you please help me? Please review my code below.</p>
  <pre><code>&lt;script type=&quot;text/javascript&quot;&gt;
  $(document).ready(function () {
      $(&quot;#submit&quot;).on(&quot;click&quot;, function () {
          var elem = {};
          elem.qty = &quot;10&quot;;
          elem.id = 1;
     
          $.ajax({
              url: '/Home/Form1/',
              type: 'POST',
              dataType: 'json',
              data: JSON.stringify(elem),
              
              success: function (data) {
                  alert(data),
                      console.log(data),
          
                      $(&quot;#output&quot;).html(data[0]);
              }
          });
      });
  });
  </code></pre>
  
  <hr />
  <pre><code>    public class Data
  {
  
      public string qty { get; set; }
      public int? id { get; set; }
  }
  </code></pre>
  <hr />
  <pre><code>        public ActionResult Form1(Data elem)
      {
  
          List&lt;Data&gt; Elements = new List&lt;Data&gt;
          {
              new Data {qty=elem.qty, id=elem.id},
              };
  
  
          return Json(Elements);
      }
  </code></pre>