First attempt at MVC. Attempting to return a JsonResult. I have this in my controller:
[AcceptVerbs(HttpVerbs.Get)]
public JsonResult GetHistoricalReports()
{
JsonResult result = Json("test");
//JsonResult result = Json(DashboardSessionRepository.Instance.HistoricalReports);
return result;
}
and in my view:
function OnHistoricalListBoxLoad(historicalListBox) {
$.getJSON('GetHistoricalReports', function (data) {
alert(data);
}
I have a break-point set inside of GetHistoricalReports and it is indeed being hit. The alert in OnHistoricalListBoxLoad never displays, however.
You need to return your result like: