当前位置: 首页>>代码示例>>C#>>正文


C# RouteCollection.MapRouteSeo方法代码示例

本文整理汇总了C#中RouteCollection.MapRouteSeo方法的典型用法代码示例。如果您正苦于以下问题:C# RouteCollection.MapRouteSeo方法的具体用法?C# RouteCollection.MapRouteSeo怎么用?C# RouteCollection.MapRouteSeo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RouteCollection的用法示例。


在下文中一共展示了RouteCollection.MapRouteSeo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRouteSeo(
                "HomeControllerOmit",
                "{action}",
                new { controller = "Home", action = "Index" }
            );
        }
开发者ID:patridge,项目名称:rss-to-jsonp,代码行数:10,代码来源:Global.asax.cs

示例2: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
            routes.IgnoreRoute("{*Content}", new { imgs = @"(.*/)?Content(/.*)?" });
            routes.IgnoreRoute("{*Scripts}", new { scripts = @"(.*/)?Scripts(/.*)?" });

            routes.MapRoute(RouteName.Home, "", MVC.Pages.Home());
        
            routes.MapRouteSeo(
                RouteName.InstallerBatchFile, "installChocolatey.cmd", new
                {
                    controller = "Pages",
                    Action = "InstallerBatchFile"
                });

            routes.MapRouteSeo(
               RouteName.Features, "features", new
               {
                   controller = "Pages",
                   Action = "Features"
               });          
            
            routes.MapRouteSeo(
               RouteName.About, "about", new
               {
                   controller = "Pages",
                   Action = "About"
               });

            routes.MapRouteSeo(
                RouteName.Notice, "notice", new
                {
                    controller = "Pages",
                    Action = "Notice"
                }); 
            
            var pricingRoute = routes.MapRoute(
                RouteName.Pricing, "pricing", new
                {
                    controller = "Pages",
                    Action = "Pricing"
                });

            routes.Redirect(r => r.MapRoute(RouteName.Compare, "compare")).To(pricingRoute);

            routes.MapRouteSeo(
                RouteName.Install, "install", new
                {
                    controller = "Pages",
                    Action = "Install"
                });

            routes.MapRouteSeo(
                RouteName.Business, "business", new
                {
                    controller = "Pages",
                    Action = "Business"
                });

            routes.MapRouteSeo(
                RouteName.FAQ, "faq", new
                {
                    controller = "Pages",
                    Action = "FAQ"
                });

            routes.MapRouteSeo(
                RouteName.Kickstarter, "kickstarter", new
                {
                    controller = "Pages",
                    Action = "Kickstarter"
                });

            routes.MapRouteSeo(
                RouteName.Terms, "terms", new
                {
                    controller = "Pages",
                    Action = "Terms"
                });

            routes.MapRouteSeo(
                RouteName.Privacy, "privacy", new
                {
                    controller = "Pages",
                    Action = "Privacy"
                });

            routes.MapRouteSeo(
                RouteName.Media, "media", new
                {
                    controller = "Pages",
                    Action = "Media"
                });  
            
            routes.MapRouteSeo(
                RouteName.Company, "company", new
                {
                    controller = "Pages",
                    Action = "Company"
                });  
//.........这里部分代码省略.........
开发者ID:jberezanski,项目名称:chocolatey.org,代码行数:101,代码来源:Routes.cs


注:本文中的RouteCollection.MapRouteSeo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。