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


C# RouteCollection.MapRouteLowerCase方法代码示例

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


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

示例1: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });

            Syndication(routes);

            Posts(routes);
            LegacyPost(routes);
            PostDetails(routes);

            Search(routes);
            Css(routes);

            routes.MapRouteLowerCase("Default",
                "{controller}/{action}",
                new { controller = "Posts", action = "Index" },
                new[] { "VulcanBlog.Web.Controllers" }
                );

            routes.MapRouteLowerCase("homepage",
               "",
               new { controller = "Posts", action = "Index" },
               new[] { "VulcanBlog.Web.Controllers" }
               );
        }
开发者ID:OpenMind,项目名称:VulcanBlog,代码行数:26,代码来源:RouteConfig.cs

示例2: RegisterRoutes

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

            // Attribute routing
            var constraintsResolver = new DefaultInlineConstraintResolver();
            constraintsResolver.ConstraintMap.Add("hasroutevalue", typeof(RouteValuePresentConstraint));
            constraintsResolver.ConstraintMap.Add("values", typeof(ValuesConstraint));
            routes.MapMvcAttributeRoutes(constraintsResolver);

            // Standard routing
            routes.MapRouteLowerCase(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { action = "index", id = UrlParameter.Optional },
                constraints: new { controller = @"(app|account|dev|error)" }
            );

            routes.MapRouteLowerCase(
                name: "Replicated",
                url: "{webalias}/{controller}/{action}/{id}",
                defaults: new { webalias = Settings.DefaultWebAlias, controller = "home", action = "index", id = UrlParameter.Optional }
            );
        }
开发者ID:winmissupport,项目名称:FeatureUpate,代码行数:27,代码来源:RouteConfig.cs

示例3: RegisterRoutes

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

            routes.MapRouteLowerCase("machines", "machine", new { controller = "Machine", action = "Index" });
            routes.MapRouteLowerCase("machine-add", "machine/add", new { controller = "Machine", action = "Add" });
            routes.MapRouteLowerCase("machine-get", "machine/{name}", new { controller = "Machine", action = "Get" });
            routes.MapRouteLowerCase("default", "", new { controller = "Home", action = "Index" });
        }
开发者ID:chartek,项目名称:orbital,代码行数:9,代码来源:Global.asax.cs

示例4: LegacyPost

        private static void LegacyPost(RouteCollection routes)
        {
            routes.MapRouteLowerCase("RedirectLegacyPostUrl",
                "archive/{year}/{month}/{day}/{slug}.aspx",
                new { controller = "LegacyPost", action = "RedirectLegacyPost" },
                new { Year = MatchPositiveInteger, Month = MatchPositiveInteger, Day = MatchPositiveInteger },
                new[] { "VulcanBlog.Web.Controllers" }
                );

            routes.MapRouteLowerCase("RedirectLegacyArchive",
               "archive/{year}/{month}/{day}.aspx",
               new { controller = "LegacyPost", action = "RedirectLegacyArchive" },
               new { Year = MatchPositiveInteger, Month = MatchPositiveInteger, Day = MatchPositiveInteger },
               new[] { "VulcanBlog.Web.Controllers" }
               );
        }
开发者ID:OpenMind,项目名称:VulcanBlog,代码行数:16,代码来源:RouteConfig.cs

示例5: Css

 private static void Css(RouteCollection routes)
 {
     routes.MapRouteLowerCase("CssController",
         "css",
         new { controller = "Css", action = "Merge" },
         new[] { "VulcanBlog.Web.Controllers" }
         );
 }
开发者ID:OpenMind,项目名称:VulcanBlog,代码行数:8,代码来源:RouteConfig.cs

示例6: RegisterRoutes

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

            routes.MapRouteLowerCase(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            );
        }
开发者ID:Alibayev,项目名称:WhiteboardWebSite,代码行数:10,代码来源:Global.asax.cs

示例7: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });

            routes.MapRouteLowerCase(
                "Default",
                "{controller}/{action}/{id}",
                new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }
开发者ID:dwick,项目名称:Me,代码行数:11,代码来源:Global.asax.cs

示例8: RegisterRoutes

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

            routes.MapMvcAttributeRoutes();

            routes.MapRouteLowerCase(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "app", action = "index", id = UrlParameter.Optional }
            );
        }
开发者ID:winmissupport,项目名称:FeatureUpate,代码行数:12,代码来源:RouteConfig.cs

示例9: PostDetails

        private static void PostDetails(RouteCollection routes)
        {
            routes.MapRouteLowerCase("PostDetailsController-Comment",
                "{id}/comment",
                new { controller = "PostDetails", action = "Comment" },
                new { httpMethod = new HttpMethodConstraint("POST"), id = MatchPositiveInteger },
                new[] { "VulcanBlog.Web.Controllers" }
                );

            routes.MapRouteLowerCase("PostDetailsController-Details",
                "{id}/{slug}",
                new { controller = "PostDetails", action = "Details", slug = UrlParameter.Optional },
                new { id = MatchPositiveInteger },
                new[] { "VulcanBlog.Web.Controllers" }
                );
        }
开发者ID:OpenMind,项目名称:VulcanBlog,代码行数:16,代码来源:RouteConfig.cs

示例10: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.LowercaseUrls = true;

            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRouteLowerCase("blog-category", "category/{category}", new { controller = "Blog", action = "Index" });
            routes.MapRouteLowerCase("blog-archive", "archive/{date}", new { controller = "Blog", action = "Index" });
            routes.MapRouteLowerCase("blog", "blog", new { controller = "Blog", action = "Index" });
            routes.MapRouteLowerCase("blogpost", "post/{url}", new { controller = "Blog", action = "SinglePost" });
            routes.MapRouteLowerCase("home", "", new { controller = "Home", action = "Index" });
            routes.MapRouteLowerCase("error", "error", new { controller = "Error", action = "Index" });

            routes.MapRouteLowerCase(
                name: "admin",
                url: "admin/{action}",
                defaults: new { controller = "admin", action = "Index", }
                );

            routes.MapRouteLowerCase("user",
                "user/{action}", new { controller = "user", action = "Index", });

            //routes.Add(new Route("robots.txt", new RouteHandler()));
        }
开发者ID:neomichi,项目名称:blog,代码行数:24,代码来源:RouteConfig.cs

示例11: RegisterRoutes

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

            routes.MapRouteLowerCase(
                "Docs",
                "article/{version}/{language}/{*key}",
                new
                    {
                        controller = MVC.Docs.Name,
                        action = MVC.Docs.ActionNames.Articles
                    },
                new
                    {
                        version = "1.0|2.0|2.5|3.0",
                        language = "csharp|java|http"
                    },
                new[] { "Raven.Documentation.Web.Controllers" });

            routes.MapRouteLowerCase(
                "Client",
                "client-api/{version}/{language}",
                new
                {
                    controller = MVC.Docs.Name,
                    action = MVC.Docs.ActionNames.Client
                },
                new
                {
                    version = "1.0|2.0|2.5|3.0",
                    language = "csharp|java|http"
                },
                new[] { "Raven.Documentation.Web.Controllers" });

            routes.MapRouteLowerCase(
                "Routes",
                "{action}/{version}/{language}",
                new
                    {
                        controller = MVC.Docs.Name
                    },
                new
                    {
                        version = "1.0|2.0|2.5|3.0",
                        language = "csharp|java|http"
                    },
                new[] { "Raven.Documentation.Web.Controllers" });

            routes.MapRouteLowerCase(
                "Default",
                "{action}/{version}/{language}",
                new
                    {
                        controller = MVC.Docs.Name,
                        action = MVC.Docs.ActionNames.Index,
                        version = "3.0",
                        language = Language.Csharp
                    },
                new
                    {
                        version = "1.0|2.0|2.5|3.0",
                        language = "csharp|java|http"
                    },
                new[] { "Raven.Documentation.Web.Controllers" });
        }
开发者ID:modulexcite,项目名称:docs-8,代码行数:65,代码来源:RouteConfig.cs

示例12: RegisterRoutes

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

            routes.MapRouteLowerCase(
                name:     "Login",
                url:      "login",
                defaults: new { controller = "authentication", action = "login", id = UrlParameter.Optional }
            );

            routes.MapRouteLowerCase(
                name:     "Default",
                url:      "{controller}/{action}/{id}",
                defaults: new { controller = "dashboard", action = "index", id = UrlParameter.Optional }
            );
        }
开发者ID:virendravyas,项目名称:backofficeshell-mvc,代码行数:16,代码来源:RouteConfig.cs

示例13: Posts

        private static void Posts(RouteCollection routes)
        {
            routes.MapRouteLowerCase("PostsByTag",
                "tags/{slug}",
                new { controller = "Posts", action = "Tag" },
                new[] { "VulcanBlog.Web.Controllers" }
                );

            routes.MapRouteLowerCase("PostsByYearMonthDay",
                "archive/{year}/{month}/{day}",
                new { controller = "Posts", action = "Archive" },
                new { Year = MatchPositiveInteger, Month = MatchPositiveInteger, Day = MatchPositiveInteger },
                new[] { "VulcanBlog.Web.Controllers" }
                );

            routes.MapRouteLowerCase("PostsByYearMonth",
                "archive/{year}/{month}",
                new { controller = "Posts", action = "Archive" },
                new { Year = MatchPositiveInteger, Month = MatchPositiveInteger },
                new[] { "VulcanBlog.Web.Controllers" }
                );

            routes.MapRouteLowerCase("PostsByYear",
                "archive/{year}",
                new { controller = "Posts", action = "Archive" },
                new { Year = MatchPositiveInteger },
                new[] { "VulcanBlog.Web.Controllers" }
                );
        }
开发者ID:OpenMind,项目名称:VulcanBlog,代码行数:29,代码来源:RouteConfig.cs

示例14: Syndication

        private static void Syndication(RouteCollection routes)
        {
            routes.MapRouteLowerCase("CommentsRssFeed",
              "rss/comments",
              new { controller = "Syndication", action = "CommentsRss" },
              new[] { "VulcanBlog.Web.Controllers" }
              );

            routes.MapRouteLowerCase("RssFeed",
              "rss/{tag}",
              new { controller = "Syndication", action = "Rss", tag = UrlParameter.Optional },
              new[] { "VulcanBlog.Web.Controllers" }
              );

            routes.MapRouteLowerCase("RsdFeed",
              "rsd",
              new { controller = "Syndication", action = "Rsd" },
              new[] { "VulcanBlog.Web.Controllers" }
              );

            routes.MapRouteLowerCase("RssFeed-LegacyUrl",
              "rss.aspx",
              new { controller = "Syndication", action = "LegacyRss" },
              new[] { "VulcanBlog.Web.Controllers" }
              );
        }
开发者ID:OpenMind,项目名称:VulcanBlog,代码行数:26,代码来源:RouteConfig.cs

示例15: Search

        private static void Search(RouteCollection routes)
        {
            routes.MapRouteLowerCase("SearchController-GoogleCse",
               "search/google_cse.xml",
               new { controller = "Search", action = "GoogleCse" },
               new[] { "VulcanBlog.Web.Controllers" }
               );

            routes.MapRouteLowerCase("SearchController",
               "search/{action}",
               new { controller = "Search", action = "SearchResult" },
               new { action = "SearchResult" },
               new[] { "VulcanBlog.Web.Controllers" }
               );
        }
开发者ID:OpenMind,项目名称:VulcanBlog,代码行数:15,代码来源:RouteConfig.cs


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