我有Ajax.BeginForm的问题。我有一个表单提交和更新部分视图的按钮。从同一动作返回重定向或部分视图
我想完成的是我可以在同一个Action中使用下面的返回语句。
// button activates this
return PartialView("PartialViewName", data);
和
// submit activates this
return Redirect(model.Url);
现在的问题是,重定向会导致问题的Ajax.BeginForm
<% using (Ajax.BeginForm("Action", "Controller", new AjaxOptions { OnSuccess = "OnSuccess", UpdateTargetId = "Container", InsertionMode = InsertionMode.Replace }, new { id = "eventAjaxForm" })) { %>
如何才能辨别是结果PartialView,还是我们重定向用户?