views:

69

answers:

1

Is there any way to debug a call coming from an AJAX post? This jQuery fires when the user hits OK:

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

If I put the breakpoint in my controller:

<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

The code never breaks on the breakpoint. I know the code is functioning because of what it's doing, but I'd like to step through the code. How can I get it to break?

+2  A: 

It should break. Use FireBug to check if your $.post works - i.e., there's no JavaScript errors, and POST request is actually made.

queen3
You're right - I had some other stuff fooling me into thinking the code was firing, but it turns out my route wasn't mapped correctly. Thanks!
gfrizzle