This is my json code.
public JsonResult GetCheckedPerm(int usr_groupId)
{
List<int> selectedradio = GrpPermBAL.GetData(usr_groupId);
return(selectedradio,JsonRequestBehavior.AllowGet);
}
This is my code to get data
public List<int> GetData(int groupId)
{
return db.ts_grp_perm_mapping
.Where(c => c.grp_id == groupId)
.Select(c => c.perm_id)
.ToList();
}
Here using above code I am returning array of int. But I am not able to result aray of int in json. I am getting below error cannot convert lambda expression type System.Web.Mvc.JsonResult because it is not a delegate type.
You just need to call the Json
method, inherited from the controller base class:
return Json(selectedradio, JsonRequestBehavior.AllowGet);
See more on this question at Stackoverflow