title: ASP.NET MVC get list from controller with ajax
body: <p>I search solution for my problem in search engine and stackoverflow.I find a lot of answer but nothing of them didn't help to me.
  Here is my controller:</p>
  
  <pre><code>[HttpGet]
      public JsonResult Get()
      {
          var cl = new List&lt;Category&gt;();
          cl.Add(new Category()
              {
                  Name = "C#"
              });
          cl.Add(new Category()
              {
                 Name = "MVC"
              });
          return Json(cl.ToList(),JsonRequestBehavior.AllowGet);
      }
  </code></pre>
  
  <p>and category class is below:</p>
  
  <pre><code> public class Category
  {
      public string Name { get; set; }
  
  }
  </code></pre>
  
  <p>In my view,I want to list each item in the data.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function() {
          $.ajax({
              type: "GET",
              url: '@Url.Action("Get","Category")',
              contentType: "application/json;charset=utf-8",
              data: { a: "testing" },
              dataType: "json",
              success: function(data) {
                  //&lt;ul&gt;
                       //&lt;li&gt;C#&lt;/li&gt;
  //&lt;li&gt;MVC&lt;/li&gt;
              },
              error: function () { alert('error....'); }
          });
      });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>How can I do it?</p>