Post with jQuery not working in Asp.Net MVC?

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.

以上就是Post with jQuery not working in Asp.Net MVC?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏