PLEASE PLEASE PLEASE Help. I looked at all the answers and I am trying to get this to work, but I am not getting any results.
my modal, which is at the bottom of my view (.cshtml)
<div class="modal fade" id="DeleteModal"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <a href="#" class="close" data-dismiss="modal">×</a> <h3 class="modal-title">Manage Profile Image Delete</h3> </div> <div class="modal-body"> hello world <h3>Are You Sure? You Want To Delete This Image</h3> <a href="#" class="btn btn-default" data-dismiss="modal">Cancel</a> <a href="#" class="btn btn-success" data-dismiss="modal" onclick="DeleteImage()">Confirm</a> </div> </div> </div>
the button that starts the show is in the html user helper that looks like this (I know this calls the function because the alert is configured to show progress)
TagBuilder trashTb = new TagBuilder("a"); trashTb.Attributes["href"] = "#"; trashTb.Attributes["onclick"] = "ConfirmDelete(" + img.Id + ")"; onclick="ConfirmDelete(15)"
in the external js file here is the show method
var ConfirmDelete = function (imageId) { alert(imageId); $("#hiddenImageId").val(imageId); $("#DeleteModal").modal("show");
}
the alert works, and as soon as I close the alert page, it loses focus, but not modal
here are my scripts in the order in which they appear in the source
<link href="/Content/Bootstrap-Lumin.css" rel="stylesheet"/>
<script src="/Scripts/modernizr-2.8.3.js"></script> <script src="/Scripts/jquery-3.3.1.js"></script> <script src="/Scripts/bootstrap.js"></script> <script src="/Scripts/JustAsk/Helpers.js"></script> <script src="/scripts/jquery.validate.min.js"></script> <script src="/scripts/jquery.validate.unobtrusive.min.js"></script> <script src="/Scripts/jquery.validate.js"></script>
Moi hawk
source share