是否可以使用以下内容实现我自己的确认对话框?
Ajax.BeginForm(new AjaxOptions { Confirm ="" })
谢谢:)
如果您没有找到答案,请检查以下问题中实现的 (OnBegin) 函数:Ajax.BeginForm 确认对话框 onBeginForm() 触发 OnSuccessForm() 之前
Ajax BeginForm 将数据发送到控制器。您需要使用 Ajax ActionLink为了显示一些确认消息,请尝试以下操作:
@Ajax.ActionLink(
"Revoke Access to all Galleries Immediately",
"ViewInvites",
"Gallery",
new AjaxOptions {
Confirm = "Are you sure you want to revoke access to all galleries? This cannot be undone.",
HttpMethod = "Post"
}
)