There is a markup
@foreach (var item in Model) { <tr> <td>@Html.DisplayFor(x => item.Id)</td> <th>@Html.DisplayFor(x => item.ManInfo.Initals)</th> <th>@Html.DisplayFor(x => item.Post)</th> <th>@Html.DisplayFor(x => item.Departament.Name)</th> <td> @Html.ActionLink("Редактировать", "Edit", new { id = item.Id }) | @Html.ActionLink("Полные данные", "Details", new { id = item.Id }, new { id = "empItem" }) | @if (User.IsInRole("admin")) { @Html.ActionLink("Удалить", "Delete", new { id = item.Id }, new { onclick = "return confirm('Вы уверены?');" }) } </td> </tr> } ... <div id="Dialog" class="modal fade"> <div id="dialogContent" class="modal-dialog"></div></div> And the script
<script type="text/javascript"> $(function () { $.ajaxSetup({ cache: false }); $("#empItem").click(function (e) { e.preventDefault(); $.get(this.href, function (data) { $('#dialogContent').html(data); $('#Dialog').modal('show'); }); }); }); A click should display a modal window and content that the controller returns.
All this code is in PartialView. After 1 click, a modal window is displayed. But with 2 clicks on another link (the next entry in the table), the link is clicked and a new page opens. And the pop-up window should open again.
What is the problem?