I have an ActionLink as below:
@Html.ActionLink("-Pg", "SupprimerPage", "Section",
new { pageId = @item.Id }, new { @id = "ConfirmDeletePage", @class = "editLink", style
= "width:30px" })
And my script:
$(document).ready(function () {
$(document).on('click', '#ConfirmDeletePage', function () {
var x=confirm("Confirm delete page?");
console.log(x);
if (x == true){
return true;
}
else {
return false;
}
});
});
When I use a hardcoded link with the <a>
tag, it works fine. But when I try to generate the link using Html.ActionLink
, the event handler is not called. any help?