I'm trying to make a post call to an action method in MVC 2. But it doesn't seem to work. I have set a break point right at the beginning of the action method, but the debugger never hits the breakpoint. What am I doing wrong? Here's the jQuery (for simplicity I have simplified it by removing parameters both from the call and the action method). Please note that the callback alert does get called, which makes it even stranger...:
$("#deleteFile").click(function () {
var url = '<%= Url.Action("DeleteFile", "Customers") %>';
$.post(url,
null,
function (data) {
alert("POSTING TO ACTION METHOD");
}
);
});
The action method signature looks like this:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult DeleteFile()
{ ... etc }
Also, other jQuery calls have worked against the action methods, with or without parameters, e.g. the .load function.