【发布时间】:2011-11-07 16:00:52
【问题描述】:
以下 JSON 调用总是命中 AJAX 错误处理程序,我不知道为什么:
$.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会发生什么? -
尝试直接在网络浏览器中访问“localhost:4497/Detail/MyTest?_=1320681138394”以获取有关异常的更多信息。
标签: ajax vb.net json model-view-controller