When I click on Ajax.ActionLink it is calling my controller twice.
<td id = @tdTag>
@Ajax.ActionLink("LL-" + item.getProjectAbbreviation(item.projectID.Value) + "-" + item.prjLessonID, "Details",
new { id = item.lessonID },
new AjaxOptions
{
HttpMethod = "POST",
UpdateTargetId = "details",
InsertionMode = InsertionMode.InsertAfter ,
OnSuccess = "showDetails()"
})
My Controller looks like this...
public ActionResult Details(int id)
{
using (LLDataContext storeDB = new LLDataContext())
{
var lesson = (from l in storeDB.lessons
where l.lessonID == id
select l).SingleOrDefault();
return PartialView(lesson);
}
}
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With