In _Layout.cshtml:
@RenderBody()
@Scripts.Render("~/scripts/jquery.unobtrusive-ajax.js")
Running the script activates all the @Ajax.ActionLink in index.cshtml. Some ajax action links load a partial view via ajax, and these partial views include more ajax action links. These new ajax action links are not activated because jquery.unobtrusive-ajax.js was run before they are on the page.
My solution was to simply run the script again on the partial view.
In _PartialView.cshtml:
@Scripts.Render("~/scripts/jquery.unobtrusive-ajax.js")
This however causes @Ajax.ActionLink in index.cshtml to be activated a second time. If I click on any of these ajax action links, their corresponding actions runs twice.
How can I activate new ajax action links in partial views without reactivating existing ajax action links?