<%= Html.ActionLink("Delete", "Delete",
new { id = item.storyId },
new { onclick = "return confirm('Are you sure you wish to delete this article?');" }) %>
上面的代码仅适用于Html.ActionLink。
对于
Ajax.ActionLink
使用下面的代码:
<%= 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" })%>
'确认' 选项指定的JavaScript确认框。
这是完美的。谢谢。 – Cameron 2011-01-13 16:03:02
真棒先生....我正在寻找很多,并思考达林在哪里..... :) – 2011-12-11 13:56:02