title: Post list using jquery ajax
body: <p>I have this code in razor</p>
  <pre><code>@{
      var aid = new List&lt;int&gt;();
      foreach (var item in Model.applications)
      {
          if (item.Status == 1)
          {
              aid.Add(item.Id);
          }
      }
  }
  </code></pre>
  <p>and in js I have this:</p>
  <pre><code>&lt;script&gt;
  function checkIfSigned() {
  
      var data = { aid: @aid };
      console.log(data);
  
      $.ajax({
          url: '@Url.Action(&quot;Method&quot;, &quot;Controller&quot;)',
          type: &quot;POST&quot;,
          data: data,
          ...
      });
  }
  </code></pre>
  
  <p>and in my controller:</p>
  <pre><code>public JsonResult Method(List&lt;int&gt; aid)
  {
    foreach (var item in aid)
    { ... }
  }
  </code></pre>
  <p>my problem is:</p>
  <blockquote>
  <p>var data = { aid: @aid };</p>
  </blockquote>
  <p>It throws an exception:</p>
  <blockquote>
  <p>Uncaught SyntaxError: Unterminated template literal</p>
  <p>var data = { aid: System.Collections.Generic.List`1[System.Int32] };</p>
  </blockquote>
  <p>What can I do? how can I post list?</p>