Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSON return format in ASP.NET MVC

Actually my question is simple. I think. But unfortunately, Google can't help me this time. I want to return a JSON in my view in this format:

[[0,"Mark Kordon",null,"My HTML - Mark Kordon"],[1,"John Doe",null,"John Doe Markup"]]

How is this possible?

like image 479
Kordonme Avatar asked Oct 14 '22 14:10

Kordonme


1 Answers

Sounds like all you want to do is return your model from the controller as a JsonResult:

public ActionResult Index()
{
    return Json(yourModel);
}
like image 191
Nick Riggs Avatar answered Oct 21 '22 05:10

Nick Riggs