How to convert a string to a JSON as the return result for a .NET ActionResult
public ActionResult fnExample() {
string json = "OK";
return Json(new ContentResult { Content = json, ContentType = "application/json" }, JsonRequestBehavior.AllowGet);
}
See also