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"//文件类型

                );

        }

你可能感兴趣的:(页面跳转)