My data is being generated at a JsonResult which output is below.
public JsonResult SampleAAA(Guid xxxxx){
//Code ...
return Json(new
{
success = true,
listA,
listB,
}, JsonRequestBehavior.AllowGet);
}
From an ActionResult I need to call that JsonResult and get those lists.
public ActionResult SampleBBB(Guid xxxxx){
var result = SampleAAA(xxxx);
//How can I access 'listA' and 'listB' ?
//Other code ...
Return View();
}
How can I access those lists? I do see result.Data
content, but I can’t reach those lists to continue my code at Visual Studio.
3
Answers
Thanks for all replies. After more research I've managed to solve with the code below.
you can try this code
and it’s much better to use JsonResult
Using .Net 5+ you can do this: