问题
This link shows how to redirect an @Ajax.BeginForm but not how to pass a route value to the new view.
Ajax.BeginForm that can redirect to a new page page/9391267#9391267
How would you redirect an @Ajax.BeginForm with a route value? The equivalent of
return RedirectToAction("Edit", new { id = acntId };
回答1:
It's no different, just use the Url helper overload with the route values:
return Json(new {
url = Url.Action("Checkout",
new { id = accntId }
)
});
来源:https://stackoverflow.com/questions/12417668/ajax-beginform-that-can-redirect-to-a-new-page-and-pass-route-value