MVC页面跳转

1.跳转到Url

        public ActionResult rdurl()
        {
            return Redirect("http://www.baidu.com");
        }

2.跳转到Action

        public ActionResult rdaction()
        {
            return RedirectToAction("Index","Eice");
        }

3.跳转到Routing规则

        public ActionResult rdrouting()
        {
            return RedirectToRoute("Default",//Route名
              new{
                  Controller = "Eice",
                  Action = "Index"
              });
        }
4.显示文件
        public ActionResult fn()
        {
            return File(
                "/Content/site.css"//文件路径
                , "text/css"//文件类型
                );
        }

posted on 2014-02-08 15:27  打补订的僧服  阅读(209)  评论(0编辑  收藏  举报

导航