3

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 };
Community
  • 1
  • 1
Joe
  • 4,143
  • 8
  • 37
  • 65

1 Answers1

4

It's no different, just use the Url helper overload with the route values:

return Json(new { 
    url = Url.Action("Checkout", 
        new { id = accntId }
    ) 
});
McGarnagle
  • 101,349
  • 31
  • 229
  • 260