Ajax.ActionLink calling controller twice Ajax.ActionLink calling controller twice ajax ajax

Ajax.ActionLink calling controller twice


I just ran in this same issue and I found that I had "jquery.unobtrusive-ajax.js" loaded twice. I removed the second instance and all is working well. To see this in action, just add it three times and create an @Ajax.ActionLink(...) with an Confirm AjaxOption. You will get confirmed multiple times.

<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")" type="text/javascript"></script>


use either of only one js not both one

<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")"></script>

or

<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")"></script>

It will solve your problems.


anAgent's answer helped me fix this problem, but as an add-on I will mention that, in my case, the multiple references to "jquery.unobtrusive-ajax.js" were in different files; one was in myView.cshtml, and the other was in _Layout.cshtml.