Model
public class AlldataPoints
{
public string name {get;set;}
public string phone {get;set;}
public string phase {get;set;}
}
Controller
public ActionResult GetResults1()
{
List<AlldataPoints> lst = (List<AlldataPoints>)Session["list"];
return Json(new { data = lst }, JsonRequestBehavior.AllowGet);
}
Script
function Pie() {
$.get("GetResults1", function (abc) {
var bac = abc;
for (i = 0; i < bac.length; i++) {
var hello = bac[0].phase;
}
});
}
As my list has 3 array objects, I want to access the value for phase of each object array and put it into variable hello but on running, hello is undefined.