MVC Redirect


1、直接Redirect后加 Controller/Action

Response.Redirect("/User/Edit");
          //  return Redirect("/User/Edit");
            return RedirectToAction("about","Home");

Response.Redirect("/User/Edit");   

2、直接return后加 Controller/Action

     return Redirect("/User/Edit");           

3、RedirectToAction方法,直接跳到一个action

 return RedirectToAction("edit");

4、跳转的页并不在该Controller中

 return RedirectToAction("about","Home");

 

 

@Url.Action("index", "product", new { id = item.Value.ID })

posted @ 2012-09-26 14:33  zyip  阅读(278)  评论(0编辑  收藏  举报