此链接显示如何重定向 @Ajax.BeginForm,但不显示如何将路由值传递到新 View 。
Ajax.BeginForm that can redirect to a new page 页/9391267#9391267
如何使用路由值重定向@Ajax.BeginForm?相当于
return RedirectToAction("Edit", new { id = acntId };
最佳答案
没什么不同,只需使用 Url
helper overload与路线值:
return Json(new {
url = Url.Action("Checkout",
new { id = accntId }
)
});
关于asp.net-mvc-3 - Ajax.BeginForm 可以重定向到新页面并传递路由值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12417668/