我在项目中使用了bootstrap类。 这是我的HTML代码:
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">رویدادها</h3>
</div>
<table id="tbl-events" class="table">
<thead>
<tr>
<th>title</th>
<th>startTime</th>
<th>endTime</th>
<th>Imae</th>
<th>description</th>
<th class="action"></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model) {
<tr>
<td>@item.Title</td>
<td>@(new PersianDateTime(item.StartTime).ToDateString())</td>
<td>@(new PersianDateTime(item.EndTime).ToDateString())</td>
<td class="event-img"><img src="@(string.IsNullOrWhiteSpace(item.Picture) ? "/images/nopic.png" : path + item.Picture)" alt="[Picture]" width="30" height="30" /></td>
<td class="event-desctript"><span>@item.Description</span></td>
<td>
<a href="/admin/event/edit/@item.ID"><i class="glyphicon glyphicon-edit"></i></a>
<a href="/admin/event/delete/@item.ID" onclick="alert()"><i class="glyphicon glyphicon-remove"></i></a>
</td>
</tr>
}
</tbody>
</table>
<div id="myModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Confirmation</h4>
</div>
<div class="modal-body">
<p>Do you want to save changes you made to document before closing?</p>
<p class="text-warning"><small>If you don't save, your changes will be lost.</small></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
</div>
这是我的js代码:
function confirm_delete() {
$('#myModal').modal('show');
}
当我点击<a href="/admin/event/delete/@item.ID" onclick="confirm_delete()"><i class="glyphicon glyphicon-remove"></i></a>
页面重新加载并从列表和对话框中删除的项目没有显示确定或取消删除!
我该如何处理这个问题?