华赐软件 Bootstrap3

MVC利用URLRoute实现伪静态

routes.MapRoute(
                    "Default", // Route name
                    "{controller}/{action}.html", // URL with parameters
                    new { controller = "Portal", action = "Index", id = UrlParameter.Optional }
                    ); //首页伪静态
            routes.MapRoute(
                    "ArticleList", // Route name
                    "{controller}/{action}/{typeId}.html", // URL with parameters
                    new { controller = "Article", action = "List", typeId = UrlParameter.Optional }
                    ); // 文章类型列表伪静态
            routes.MapRoute(
                    "ArticleDetail", // Route name
                    "{controller}/{action}/{id}.html", // URL with parameters
                    new { controller = "Article", action = "Detail",id = UrlParameter.Optional }
                    ); // 文章详情页伪静态
            routes.MapRoute(
                    "JobList", // Route name
                    "{controller}/{action}/{id}.html", // URL with parameters
                    new { controller = "Job", action = "Detail", id = UrlParameter.Optional }
                    ); // TODO
            routes.MapRoute(
                    "JobDetail", // Route name
                    "{controller}/{action}/{id}.html", // URL with parameters
                    new { controller = "Article", action = "Detail", id = UrlParameter.Optional }
                    ); // TODO

posted @ 2013-11-27 17:31  OpenCsharp.Net  阅读(396)  评论(0编辑  收藏  举报
华赐软件 Bootstrap3
w.huacisoft.com">华赐软件 Bootstrap3