I have a button in dropdown menu like this:
<li><button class="btn btn-white btn-sm delete-group fa fa-trash" dataid="@item.InterimReviewId">Delete</button></li>
that calls javascript functions like this:
$('.delete-group').click(function () {
var url = "/Fiscalizations/Delete";
var id = $(this).attr('dataid');
$.get(url + '/' + id, function (data) {
$('#editor-content-container').html(data);
$('#editor-container').modal('show');
});
});
that calls modal window:
<div class="modal fade" id="editor-container" tabindex="-1"
role="dialog" aria-labelledby="editor-title">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content animated flipInY" id="editor-content-container"></div>
</div>
</div>
and all works as I expected. My goal is to swap button with ActionLink and here my problems start.
I wrote something like this:
<li>@Html.ActionLink("Delete Interim Review", "Delete", "InterimReviews", new { dataid = item.InterimReviewId }, new { @class = "delete-group" })</li>
which correctly calls the function but instead of a modal window it calls bad HTTP request with address /InterimReviews/Delete?dataid=1
I will be grateful for any hints how to solve the problem
Edit: I solved the problem with bad request ( different parameter names in contoller and Actionlink). So now the only one problem is that with ActionLink javascript fuction doesn't fire modal window