这是ajax调用:
$.ajax({ url: "/TheControllerName/MyMethod",
type: "GET",
contentType: "application/json", dataType: 'json',
success: function (data) {
alert('something');
},
error: function (httpRequest, textStatus, errorThrown) {
console.log("status=" + textStatus + ",error=" + errorThrown);
}
})//end of ajax call
这是方法:
public JsonResult MyMethod()
{
//get some list
return Json(theList, JsonRequestBehavior.AllowGet);
}
该方法被调用并且断点成功出现,但我收到此错误:500 (Internal Server Error) status=error,error=Internal Server Error