html
<script type="text/javascript">
$(document).ready(function () {
$(".link-delete").click(function () {
var id = $(this).attr("data-id"); // get the school id, html 5 versoin: var id = $(this).data("id");
$("#deleteConfirm").attr("data-id", id); // set the id to the delete confirm link button
$("#modal-delete").modal("show"); // show delete confirmation modal window
});
$("#deleteConfirm").click(function() {
var id = $(this).attr("data-id");
deleteSchoolTerm(id);
});
function deleteSchoolTerm(id) {
ajax---->to delete action
}
<a href="#" class="link-delete" data-id="@Model.***">Delete</a>
<!-- modal window (delete confirmation) -->
<div id="modal-delete" class="modal hide fade">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3>Delete</h3>
</div>
<div class="modal-body">
<div id="result" style="display:none;"></div>
<p>You are about to delete the student.</p>
<p>Do you want to proceed?</p>
</div>
<div class="modal-footer">
<a href="#" class="btn btn-danger" id="deleteConfirm">Yes</a>
<button class="btn" data-dismiss="modal" aria-hidden="true">No</button>
</div>
</div>