title: Return Json object from controller and parse in jquery
body: <p><em>Controller:</em></p>
  
  <pre><code>int intId = 0;
  var jsonlist = new JsonResult();
  for (var i = 0; i &lt; model2.Count; i++) {
      intId = (int) model2[i].Id;
      var abc = objModel.GetSubCategories(ID, intId);
      Json(new {
              jsonlist = abc
          },
          JsonRequestBehavior.AllowGet);
  }
  ViewData["SubTypes"] = jsonlist;
  
  @
  ViewBag.Total = intTotal;
  return View(model);
  }
  </code></pre>
  
  <p><em>JS:</em></p>
  
  <pre><code>var myArray = new Array();
  var list = ('&lt;%: ViewData["SubTypes"] %&gt;');
  alert(list);
  myArray = $.parseJSON(list);
  ////        var obj = new Object();
  //        var obj = JSON.parse(myArray);
  //        alert(obj);
  </code></pre>
  
  <p>The alert is <code>System.Web.MVC.JsonResult</code>. I am not able to parse it. </p>
  
  <p>What am I doing wrong?</p>