I have an ActionLink in my view. When clicked, an action in my controller is fired (I placed a breakpoint to check). It works only the first time the link is clicked. Other times, the breakpoint in my action controller is never reached.
@Ajax.ActionLink("Remove image", "RemoveImage", new { projectID = Model.ProjectID }, new AjaxOptions { OnSuccess="ImageRemovedSuccess" })
The function “ImageRemovedSuccess” for the OnSuccess ajax event is well fired but the action in the controller is not fired.
Any suggestions?
Thanks.
Your browser caches the response. So the second time when you send the request browser will not forward it to the server because the same request was sent to the server before and the browser will return the cached response to the page.
Decorate the action method not to cache the response in between.
Make sure you press “Ctrl + F5” on the browser before you check it.