I am using an onclick on a delete call
<input type='button' value='Delete' class='btn btn-danger btn-sm'
id='btn_Delete6' profile-id='#= ProfileID#'>
and this is the script that it runs
$(document).ready(function () {
$('body').on('click', 'td input', function () {
swal({
title: "Are you sure?",
text: "You will not be able to recover this imaginary file!",
type: "warning",
showCancelButton: true,
confirmButtonClass: 'btn-danger',
confirmButtonText: 'Yes, delete it!',
cancelButtonText: "No, cancel plx!",
closeOnConfirm: false,
closeOnCancel: false
},
function (isConfirm) {
if (isConfirm) {
swal("Deleted!", "Your imaginary file has been deleted!", "success");
} else {
swal("Cancelled", "Your imaginary file is safe :)", "error");
}
});
});
})
The issue is that I don't know how to get the url to run during the isConfirm function. I pass the profileID of the row into the url with profile-id
. How can I call the /OBProfile/Delete/"profileid"
that I need? This is done using SweetAlert