<%= Html.ActionLink("Delete", "Delete", new { id = item.storyId }, new { onclick = "return confirm('Are you sure you wish to delete this article?');" }) %>
The above code only works for Html.ActionLink.
For
Ajax.ActionLink
use the following code:
<%= Ajax.ActionLink(" ", "deleteMeeting", new { id = Model.eventID, subid = subItem.ID, fordate = forDate, forslot = forslot }, new AjaxOptions { Confirm = "Are you sure you wish to delete?", UpdateTargetId = "Appointments", HttpMethod = "Get", InsertionMode = InsertionMode.Replace, LoadingElementId = "div_loading" }, new { @class = "DeleteApointmentsforevent" })%>
The Confirm option specifies the javascript confirmation flag.
T Gupta Mar 11 '13 at 8:55 2013-03-11 08:55
source share