I’m using ASP.Net MVC to make my app
I’m actually trying to delete an entry from my DB, first i must have a confirmation message and when the action is completed i want to refresh my PartialView
here’s my code
<%= Ajax.ActionLink(
"Supprimer",
"Delete",
"Users",
new { item.ID },
new AjaxOptions {
Confirm= "confirmMethod",
UpdateTargetId = "usersListeID",
OnSuccess = "success"
}
)%>
The problem is the confirm option is a simple ajax message, i want to use my own message (well structured because I used ajax & jQuery to make it)
function confirmMethod() {
$.msgBox({
title: "Demande de confirmation",
content: "Voulez-vous effectuer cette action?",
type: "confirm",
buttons: [{ value: "Oui" }, { value: "Non"}],
success: function (result) {
if (result == "Non") {
abort();
}
}
});}
You could use a standard
Html.ActionLink:and then use jQuery to subscribe to the
.click()event of tis anchor: