title: How can i pass generic list from view to controller action with jquery
body: <pre><code>//vm    
  class myViewModel {
      public Ilist&lt;GenericClass&gt; MyList {get;set;}
      }
  
  //controller
  [HttpPost]
  public ActionResult MyAction(IList&lt;GenericClass&gt; myList){
  // do something with list
  }
  
  // view
  ım trying solution like this 
  @model myViewModel 
  ....
  
  &lt;script&gt;
  var list = (@Model.MyList)
   $.post(&quot;@Url.Action(&quot;MyAction&quot;, &quot;MyController&quot;)&quot;, { myList: list }, function (d) {
                  console.log(d);
              });
  &lt;/script&gt;
  </code></pre>
  <p>How can ı pass generic list from view to my action. My list in my view model and ı want use it from view model like @Model.myList.</p>