您的位置:首页 > 其它

MVC中Controller中的跳转

2016-07-26 20:24 204 查看
Controller中跳转方式:

1、Response.Redirect("/Custom2/Index");

2、return Redirect("/Custom2/Index");

3、return RedirectToAction("/Custom2/Index")

     多个重载,其中传递参数:

     return RedirectToAction("Come", "Custom", new Person { Id = "0", Name = "asdf" });
    Custom中Action(Come)

     public ActionResult Come(Person p)

        {

            return View();

        }

    
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: