有没有办法调试来自AJAX帖子的调用?

时间:2009-11-04 18:31:22

标签: jquery asp.net-mvc ajax debugging post

有没有办法调试来自AJAX帖子的电话?当用户点击OK时,此jQuery将触发:

$.post(
    "/Detail/Copy",
    {
        bpid: $("#benefit_plan_id").val(),
        year: $("#copyYear").val(),
        plan: $(this).val()
    },
    function(data) {  }
);

如果我把断点放在我的控制器中:

<AcceptVerbs(HttpVerbs.Post), ValidateInput(False)> _
Function Copy(ByVal bpid As Integer, ByVal year As Integer, ByVal plan As Integer) As ActionResult

    '{break here}
    DoSomeWork(bpid, year, plan)

    Return View("Close")

End Function

代码永远不会破坏断点。我知道代码正在运行,因为它正在做什么,但我想逐步完成代码。我怎么能让它破裂?

1 个答案:

答案 0 :(得分:2)

应该打破。使用FireBug检查您的$.post是否有效 - 即没有JavaScript错误,并且实际发出了POST请求。