MVC页面跳转

时间:2014-02-09 15:37:57   收藏:0   阅读:562

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

原文:http://www.cnblogs.com/zhaoliang831214/p/3540544.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!