以下JSON电话总是打AJAX错误处理程序,我想不通为什么:为什么这个基本的json调用不起作用?
$.ajax({
type: "GET",
url: '<%= Url.Action("MyTest", "Detail") %>',
dataType: "json",
error: function (xhr, status, error) {
alert(xhr + " | " + status + " | " + error);
},
success: function (json) {
alert(json);
}
});
我得到的是Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://localhost:4497/Detail/MyTest?_=1320681138394
当我设置一个控制器中的断点,我可以看到它已经到达,所以我不确定请求在哪里下降。下面是在DetailController行动:
Function MyTest() As JsonResult
Return Json("Hello")
End Function
任何想法?
当直接访问'http:// localhost:4497/Detail/MyTest'时会发生什么? – Sorpigal
直接在您的Web浏览器中访问“http:// localhost:4497/Detail/MyTest?_ = 1320681138394”以获取有关该异常的更多信息。 –