public ActionResult LoadPage()
{
Student result = getFirst();
//Returns a serialized JSON object.
return Json(result, JsonRequestBehavior.AllowGet);
}
Action methods typically return a result that is known as an action result. The ActionResult class is the base class for all action results. The ActionInvoker decide which type of action result to return based on the task that the action method is performing.
It is possible be explicit about what type to return, but generally it not necessary.
public JsonResult LoadPage()
{
Student result = getFirst();
//Returns a serialized JSON object.
return Json(result, JsonRequestBehavior.AllowGet);
}