How to return JSON from ASP.NET MVC Controller ?

If you want to return JSON data from the ASP.NET MVC Controller , we can easily do that by returning the Json like the was shown in the below sample code

How to return JSON from ASP.NET MVC Controller ?

public ActionResult IndexActionMethod()

{

// Get the data to the data variable which is to be serialized to JSON

var data = "";

return Json(data);

}