当前位置: 首页>>代码示例>>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.MapRouteLowercase(
                name: "TopicPage",
                url: "page/{name}",
                defaults: new { controller = "TopicPage", action = "Index" },
                namespaces: new String[] { "SDNUOJ.Controllers" }
            );

            routes.MapRouteLowercase(
                name: "ProblemStatistic",
                url: "problem/statistic/{pid}/{id}/{lang}/{order}",
                defaults: new { controller = "Problem", action = "Statistic", id = UrlParameter.Optional, lang = UrlParameter.Optional, order = UrlParameter.Optional },
                constraints: new { pid = @"\d+" },
                namespaces: new String[] { "SDNUOJ.Controllers" }
            );

            routes.MapRouteLowercase(
                name: "ProblemForum",
                url: "problem/forum/{pid}/{id}",
                defaults: new { controller = "Forum", action = "Problem", id = UrlParameter.Optional },
                constraints: new { pid = @"\d+" },
                namespaces: new String[] { "SDNUOJ.Controllers" }
            );

            routes.MapRouteLowercase(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                namespaces: new String[] { "SDNUOJ.Controllers" }
            );
        }
开发者ID:prostickman,项目名称:sdnuoj,代码行数:34,代码来源:GlobalRoutesTable.cs

示例2: RegisterRoutes

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

            routes.MapRouteLowercase(
                "NotFound", // Route name
                "NotFound", // URL with parameters
                new { controller = "Home", action = "NotFound" } // Parameter defaults
            );

            routes.MapRouteLowercase(
                "Forbidden", // Route name
                "Forbidden", // URL with parameters
                new { controller = "Home", action = "Forbidden" } // Parameter defaults
            );

            routes.MapRouteLowercase(
                "BadRequest", // Route name
                "BadRequest", // URL with parameters
                new { controller = "Home", action = "BadRequest" } // Parameter defaults
            );

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

示例3: RegisterRoutes

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

            routes.MapRouteLowercase(
                name: "Tags",
                url: "blog/tags/{urlSlug}",
                defaults: new { controller = "Blog", action = "Tags", urlSlug = UrlParameter.Optional }
            );

            routes.MapRouteLowercase(
                name: "Archives",
                url: "blog/archive/{month}/{year}",
                defaults: new { controller = "Blog", action = "Archive", month = UrlParameter.Optional, year = UrlParameter.Optional }
            );

            routes.MapRouteLowercase(
                name: "BlogPost",
                url: "blog/{urlSlug}",
                defaults: new { controller = "Blog", action = "BlogPost" }
            );

            routes.MapRouteLowercase(
                name: "LoremLewis",
                url: "loremlewis",
                defaults: new { controller = "Ipsums", action = "LoremLewis" }
            );

            routes.MapRouteLowercase(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }
开发者ID:tommyenglish,项目名称:tommysblog,代码行数:34,代码来源:RouteConfig.cs

示例4: RegisterRoutes

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

            routes.MapRouteLowercase(
                name: "Leads",
                url: "Leads/{id}/{order}",
                defaults: new { controller = "Lead", action = "Index", id = UrlParameter.Optional, order = UrlParameter.Optional }
            );

            routes.MapRouteLowercase(
                name: "Sales",
                url: "Sales/{id}/{order}",
                defaults: new { controller = "Sale", action = "Index", id = UrlParameter.Optional, order = UrlParameter.Optional }
            );

            routes.MapRouteLowercase(
                name: "Contacts",
                url: "Contacts/{order}",
                defaults: new { controller = "Contact", action = "Index", order = UrlParameter.Optional }
            );

            routes.MapRouteLowercase(
                name: "Order",
                url: "{controller}/{action}/{id}/{order}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional, order = UrlParameter.Optional }
            );

            routes.MapRouteLowercase(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }
开发者ID:GiscardBiamby,项目名称:crumb-crm,代码行数:34,代码来源:RouteConfig.cs

示例5: RegisterRoutes

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

            routes.MapRouteLowercase(
                "Default",
                "", // Only matches the empty URL (i.e. ~/)
                new { controller = "Search", action = "Index" }
            );

            routes.MapRouteLowercase(
                "Queue",
                "Queue/",
                new { controller = "Queue", action = "Index" }
            );

            //routes.MapRouteLowercase("Report", "{controller}/Report/{action}");

            routes.MapRouteLowercase(
                "SlugsAfterId",
                "{controller}/{action}/{id}/{slug}",
                new { action = "Edit", slug = "" }
            );

            routes.MapRouteLowercase(null, "{controller}/{action}");
        }
开发者ID:jimlyndon,项目名称:cloudcre,代码行数:27,代码来源:Global.asax.cs

示例6: RegisterRoutes

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

            routes.MapRouteLowercase("Admin", "admin", new { controller = "Admin", action = "Index" });
            routes.MapRouteLowercase("AppNoodles", "app/{*path}", new { controller = "App", action = "Index" });
            routes.MapRouteLowercase("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", Id = null as object });
        }
开发者ID:jpoehls,项目名称:Template,代码行数:8,代码来源:Global.asax.cs

示例7: RegisterRoutes

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

            routes.MapRouteLowercase("home index", "", new {controller = "home", action = "index"});
            routes.MapRouteLowercase("home about", "about", new {controller = "home", action = "about"});

            routes.MapRouteLowercase("default", "{controller}/{action}/{id}", new {action = "index", id = UrlParameter.Optional});
        }
开发者ID:rtennys,项目名称:Toph,代码行数:9,代码来源:RouteConfig.cs

示例8: RegisterRoutes

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

            routes.MapRouteLowercase("Documentation", "documentation/{view}",
                new { controller = "Documentation", action = "Index", id = UrlParameter.Optional });

            routes.MapRouteLowercase("Default", "{controller}/{action}/{id}",
                new { controller = "Home", action = "Index", id = UrlParameter.Optional });
        }
开发者ID:ByteCarrot,项目名称:Datajo,代码行数:10,代码来源:RouteConfig.cs

示例9: RegisterRoutes

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

            routes.MapRouteLowercase(
                "topic", // Route name
                "topic/{topic}/{id}", // URL with parameters
                new { controller = "topic", action = "blog", id = "1" } // Parameter defaults
                );

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

示例10: RegisterRoutes

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

            //routes.MapRouteLowercase(
            //        "root_default",
            //        "",
            //        new { area= "wedding", controller = "Home", action = "Index", id = UrlParameter.Optional },
            //        new string[] { "Wedding.Areas.wedding.Controllers" }
            //        );

            routes.MapRouteLowercase(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                new string[] { "Wedding.Controllers" }
            );

            //routes.MapRouteLowercase(
            //    "Default", // Route name
            //    "wedding/{controller}/{action}/{id}", // URL with parameters
            //    new { controller = "Home", action = "Index", id = UrlParameter.Optional }, // Parameter defaults
            //    new string[] { "Wedding.Areas.wedding.Controllers" }
            //);
        }
开发者ID:simonneedham,项目名称:Wedding,代码行数:25,代码来源:Global.asax.cs

示例11: RegisterViewRoutes

 internal static void RegisterViewRoutes(RouteCollection routes)
 {
     routes.MapRouteLowercase(
         "Default", "{controller}/{action}/{id}",
         new { controller = "Home", action = "Index", id = UrlParameter.Optional },
         new { id = UrlConstraint.OptionalNumeric });
 }
开发者ID:bevacqua,项目名称:Swarm,代码行数:7,代码来源:Routing.cs

示例12: RegisterRoutes

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

            routes.MapRouteLowercase(
                name: "WithSeasonNumber",
                url: "{controller}/{action}/{seriesId}/{seasonNumber}"
            );

            routes.MapRouteLowercase(
                name: "SeriesId",
                url: "{controller}/{action}/{seriesId}",
                defaults: new { controller = "Series", action = "Index", seriesId = UrlParameter.Optional }
            );
        }
开发者ID:Arista2,项目名称:NzbDrone,代码行数:17,代码来源:Global.asax.cs

示例13: Register

        public void Register(RouteCollection Routes)
        {
            // Error Routes
            Routes.MapRouteLowercase(
                "Generic Error",
                "Error/{action}",
                new { controller = "Error", action = "Index" },
                new { controller = "Error" }
            );

            // Catch all
            Routes.MapRouteLowercase(
                "Error",
                "{*url}",
                new { controller = "Error", action = "NotFound" }
            );
        }
开发者ID:nathanpalmer,项目名称:LittleBanking,代码行数:17,代码来源:ErrorRoutes.cs

示例14: Register

        public void Register(RouteCollection Routes)
        {
            // Generic Actions
            Routes.MapRouteLowercase(
                "Generic pages for site",
                "{action}",
                new { controller = "Public" },
                new { controller = "Public", action = "(FAQ|About)" }
                );

            // Default route
            Routes.MapRouteLowercase(
                "Landing Page",
                "",
                new {controller = "Public", action = "Home", page = 1}
                );
        }
开发者ID:nathanpalmer,项目名称:LittleBanking,代码行数:17,代码来源:PublicRoutes.cs

示例15: RegisterRoutes

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

            routes.MapRouteLowercase("home index", "", new {controller = "home", action = "index"});
            routes.MapRouteLowercase("home about", "about", new {controller = "home", action = "about"});
            routes.MapRouteLowercase("home throw", "throw", new {controller = "home", action = "throw"});

            routes.MapRouteLowercase("account", "account/{action}/{id}", new {controller = "account", action = "manage", id = UrlParameter.Optional});
            routes.MapRouteLowercase("admin", "admin/{action}/{id}", new {controller = "admin", action = "index", id = UrlParameter.Optional});
            routes.MapRouteLowercase("ping", "ping/{action}/{id}", new {controller = "ping", action = "index", id = UrlParameter.Optional});

            routes.MapRouteLowercase("shopping lists add", "add", new {controller = "shoppinglists", action = "add"});
            routes.MapRouteLowercase("shopping lists index", "{username}", new {controller = "shoppinglists", action = "index"});

            routes.MapRouteLowercase("shopping list add item", "{username}/{shoppinglist}/add/{action}", new {controller = "addlistitem", action = "index"});
            routes.MapRouteLowercase("shopping lists", "{username}/{shoppinglist}/{action}/{id}", new {controller = "shoppinglists", action = "show", id = UrlParameter.Optional});
        }
开发者ID:rtennys,项目名称:Momo,代码行数:18,代码来源:RouteConfig.cs


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