I have this link, in an effort to implement AJAX log on, on my page:
<%= Ajax.ActionLink("Log On", "LogOn", "Account", new AjaxOptions {
UpdateTargetId = "lll",
Confirm = "blah"}) %>
There’s a div with id lll nearby. When I click the link, I get the blah confirmation (just added for debugging purposes, the behavior without it it’s the same) but then nothing happens. No request ever reaches the server (because I have a breakpoint on the LogOn action method). That is in Chrome and IE8. In FF3 it opens the logon view but as a page, it doesn’t download it through AJAX.
Any ideas what might be wrong?
The problem was that the ajax action link makes a POST request by default and it was being directed to the other LogOn method (the one accepting POST) and that’s why I wasn’t hitting the breakpoint Also, it was failing because the necessary POST data was not being sent. Adding HttpMethod to the action link fixed it: