今天突然遇到这个问题。

百度了好多都是下这个模板

  1. 1、直接Redirect后加 Controller/Action
  2. Response.Redirect("/User/Edit");
  3. // return Redirect("/User/Edit");
  4. return RedirectToAction("about","Home");
  5. Response.Redirect("/User/Edit");

 

但是从来就没有人说清楚RedirectToAction哪里来的。。真是坑啊

 

后面发现下面方法,亲测可用

public ModelAndView controllA()

{

  return new ModelAndView("redirect:xxxx");

  //xxxx为本controller中的另一个方法,例如redirect:mine-reply;p=test?userId=2

}