MVC Ajax.beginform自定义确认对话

时间:2013-09-20 13:30:12

标签: c# asp.net-mvc asp.net-ajax

是否可以使用以下内容实现我自己的确认对话?

Ajax.BeginForm(new AjaxOptions { Confirm ="" })

谢谢:)

2 个答案:

答案 0 :(得分:0)

如果您没有找到答案,请检查以下问题中实现的(OnBegin)函数: Ajax.BeginForm Confirmation Dialog onBeginForm() before triggering OnSuccessForm()

答案 1 :(得分:-1)

Ajax BeginForm将数据发送到Controller。 您需要使用Ajax ActionLink İn为了显示一些确认消息,请尝试以下内容:

@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"
}
)