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


C# RouteCollection.IgnoreRoute方法代码示例

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


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

示例1: Register

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

            routes.MapRoute("InstallerRoute", "install", new { controller = "Install", action = "Setup" });
            routes.MapRoute("Task Execution", TaskExecutionController.ExecutePendingTasksURL,
                new { controller = "TaskExecution", action = "Execute" });
            routes.MapRoute("Sitemap", "sitemap.xml", new { controller = "SEO", action = "Sitemap" });
            routes.MapRoute("robots.txt", "robots.txt", new { controller = "SEO", action = "Robots" });
            routes.MapRoute("ckeditor Config", "Areas/Admin/Content/Editors/ckeditor/config.js",
                new { controller = "CKEditor", action = "Config" });

            routes.MapRoute("Logout", "logout", new { controller = "Logout", action = "Logout" },
                new[] { typeof(LogoutController).Namespace });

            routes.MapRoute("zones", "render-widget", new { controller = "Widget", action = "Show" },
                new[] { typeof(WidgetController).Namespace });

            routes.MapRoute("ajax content save", "admintools/savebodycontent",
                new { controller = "AdminTools", action = "SaveBodyContent" });

            routes.MapRoute("form save", "save-form/{id}", new { controller = "Form", action = "Save" },
                new[] { typeof(FormController).Namespace });

            routes.Add(new Route("{*data}", new RouteValueDictionary(), new RouteValueDictionary(),
                new MrCMSRouteHandler()));
        }
开发者ID:neozhu,项目名称:MrCMS,代码行数:28,代码来源:MrCMSRouteRegistration.cs

示例2: RegisterRoutes

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

            routes.MapRoute(
                "ContentPaginated", // Route name
                "{page}/{*path}", // URL with parameters
                new { controller = "Content", action = "Index" }, // Parameter defaults
                new
                {
                    path = new DocumentPathConstraint(DependencyResolver.Current.GetService<IContentService>()),
                    page = @"\d*"
                },
                new string[] { "NCL.Web.Controllers" }
            );

            routes.MapRoute(
                "Content", // Route name
                "{*path}", // URL with parameters
                new { controller = "Content", action = "Index" }, // Parameter defaults
                new {
                    path = new DocumentPathConstraint(DependencyResolver.Current.GetService<IContentService>()),
                },
                new string[] { "NCL.Web.Controllers" }
            );

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

示例3: RegisterRoutes

		public static void RegisterRoutes(RouteCollection routes)
		{
			routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
			routes.IgnoreRoute("favicon.ico");
			routes.IgnoreRoute("{composite}/{*pathInfo}");
			routes.MapRoute("Default", "{controller}/{action}", new { controller = "Home", action = "Index" });
		}
开发者ID:smhinsey,项目名称:Euclid,代码行数:7,代码来源:Global.asax.cs

示例4: RegisterRoutes

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

            routes.MapRoute(
                "Customer", // Route name
                "Customer/{action}/{customerCode}", // URL with parameters
                new { controller = "Customer", action = "Details" } // Parameter defaults
                //new { customerCode = @"[1-9a-zA-Z]+" }
                );

            routes.MapRoute(
                "Paged", // Route name
                "{controller}/{action}/{page}/{pageSize}", // URL with parameters
                new { controller = "Home", action = "Index" }, // Parameter defaults
                new { page = @"\d+", pageSize = @"\d+" }
                );

            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            );

        }
开发者ID:ljvblfz,项目名称:MicrosoftNLayerApp,代码行数:26,代码来源:Global.asax.cs

示例5: RegisterRoutes

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

            routes.MapRoute(
                "LogOn", // Route name
                "logon", // URL with parameters
                new { controller = "Account", action = "LogOn" } // Parameter defaults
            );

            routes.MapRoute(
                "LogIn", // Route name
                "login", // URL with parameters
                new { controller = "Account", action = "LogOn" } // Parameter defaults
            );

            routes.MapRoute(
                "Content", // Route name
                "{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            );

            routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            );

        }
开发者ID:fathurxzz,项目名称:aleqx,代码行数:30,代码来源:Global.asax.cs

示例6: 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

示例7: RegisterRoutes

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

            routes.MapRoutes<Routes>();
        }
开发者ID:seba-i,项目名称:Template,代码行数:7,代码来源:Global.asax.cs

示例8: RegisterRoutes

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

            routes.MapRoute
                (
                    "ServiceEntryPoint",
                    "Service/{service}/{structureId}/{containerId}/{workspaceTypeName}",
                    new {controller = "Home", action = "Index"}
                );

            routes.MapRoute
                (
                    "Service",
                    "Service/{service}/{controller}/{action}",
                    new {service = "", controller = "Home", action = "Index"}
                );

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

示例9: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.IgnoreRoute("{*allappleicon}", new { allappleicon = @"apple-touch-icon-.*\.png(/.*)?" });
            routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
            routes.IgnoreRoute("{page}.html");

            routes.MapRoute(
                "illos",
                "illos",
                new { controller = "Portfolio", action = "Illos" });

            routes.MapRoute(
                "piccies",
                "piccies",
                new { controller = "Portfolio", action = "Piccies" });

            routes.MapRoute(
                "detail",
                "detail/{id}",
                new { controller = "Portfolio", action = "Detail", id = UrlParameter.Optional });

            routes.MapRoute(
                "Default",
                "{controller}/{action}/{id}",
                new { controller = "Portfolio", action = "Index", id = UrlParameter.Optional });
        }
开发者ID:mikaelahlinder,项目名称:so.web.asp,代码行数:27,代码来源:RouteConfig.cs

示例10: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{*allcss}", new {allcss = @".*\.css(/.*)?"});
            routes.IgnoreRoute("{*alljs}", new {allcss = @".*\.js(/.*)?"});
            routes.IgnoreRoute("{*allaspx}", new {allaspx = @".*\.aspx(/.*)?"});
            routes.IgnoreRoute("{*favicon}", new {favicon = @"(.*/)?favicon.ico(/.*)?"});
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute("Sitemap", "sitemap.xml", new {controller = "Content", action = "SiteMap"});
            routes.MapRoute("Robots", "robots.txt", new {controller = "Content", action = "Robots"});

            // include all plugin routes
            foreach (var registry in ObjectFactory.Model.GetAllPossible<IRouteRegistry>())
            {
                registry.RegisterRoutes(routes);
            }

            routes.MapRoute("Admin", "admin", new {controller = "Admin", action = "SignIn"});
            routes.MapRoute("AdminPanel", "admin-panel/{pageId}", new {controller = "Admin", action = "Panel"});
            routes.MapRoute("SignOut", "signout", new {controller = "Admin", action = "SignOut"});

            routes.MapEyePatchRoute(
                "EyePatch", // Route name
                "{controller}/{action}", // URL with parameters
                new {controller = "Admin", action = "Install"}, // Parameter defaults
                null, null
                );

            routes.MapRoute("Default", "{controller}/{action}/{id}", new {id = UrlParameter.Optional});
        }
开发者ID:tuanvt,项目名称:EyePatch,代码行数:30,代码来源:Global.asax.cs

示例11: RegisterRoutes

 public static void RegisterRoutes(RouteCollection routes)
 {
     routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
     routes.IgnoreRoute("Logs/elmah.axd/{*pathInfo}");
     routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Cribs", action = "Index", id = UrlParameter.Optional }
     );
 }
开发者ID:goementhomiwa,项目名称:Cribs,代码行数:7,代码来源:RouteConfig.cs

示例12: RegisterRoutes

 public static void RegisterRoutes(RouteCollection routes)
 {
     routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
     routes.IgnoreRoute("Content/{*pathInfo}");
     routes.IgnoreRoute("Scripts/{*pathInfo}");
     //routes.MapRoute(
     //    "Default", // Route name
     //    "{controller}/{action}/{id}", // URL with parameters
     //    new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
     //);
     routes.MapRoute("Home","", new { controller = "Home", action = "Index" });
     routes.MapRoute("FBLogin","Facebooklogin", new { controller = "FacebookLogin", action = "Index" });
     routes.MapRoute("Account","Account/{action}",new { controller = "Account", Action = "Index" });
     routes.MapRoute("Galleries", "Galleries", new { controller = "Galleries", Action = "Index" });
     routes.MapRoute("GalleryView", "Galleries/{id}", new { controller = "Galleries", Action = "View", id = UrlParameter.Optional });
     routes.MapRoute("Events", "Events", new { controller = "Events", Action = "Index" });
     routes.MapRoute("EventView", "Events/{id}", new { controller = "Events", Action = "View", id = UrlParameter.Optional });
     routes.MapRoute("EventLineup", "Events/{id}/Lineup", new { controller = "Events", Action = "Lineup", id = UrlParameter.Optional });
     routes.MapRoute("EventTickets", "Events/{id}/Tickets", new { controller = "Events", Action = "Tickets", id = UrlParameter.Optional });
     routes.MapRoute("BookingStage1", "Bookings/{eventName}/{ticketID}/CustomerAccount", new { controller = "Booking", Action = "CustomerAccount", eventName = UrlParameter.Optional, ticketID = UrlParameter.Optional });
     routes.MapRoute("BookingLogin", "Bookings/{eventName}/{ticketID}/AccountLogin", new { controller = "Booking", Action = "AccountLogin", eventName = UrlParameter.Optional, ticketID = UrlParameter.Optional });
     routes.MapRoute("ReservationSummary", "Bookings/ReservationSummary/{id}", new { controller = "Booking", Action = "ReservationSummary",id = UrlParameter.Optional, bookingID = UrlParameter.Optional });
     routes.MapRoute("MakePayment", "Bookings/MakePayment/{id}", new { controller = "Booking", Action = "MakePayment", id = UrlParameter.Optional, bookingID = UrlParameter.Optional });
     routes.MapRoute("PaymentResult", "Payments/PaymentResult", new { controller = "Payments", Action = "PaymentResult" });
     routes.MapRoute("SoldOut", "Bookings/SoldOut", new { controller = "Booking", Action = "SoldOut" });
     routes.MapRoute("ArtistBio", "Artists/Bio/{id}", new { controller = "Artists", Action = "Bio", id = UrlParameter.Optional});
     routes.MapRoute("Page", "{*slug}", new { controller = "Page", action = "ChoosePage" });
 }
开发者ID:s-leonard,项目名称:Tarts,代码行数:28,代码来源:Global.asax.cs

示例13: RegisterRoutes

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

            routes.MapRoute(
                "ServerJS", // Route name
                "ServerJS/{action}/{key}", // URL with parameters
                new { controller = "ServerJS", action = "", key = UrlParameter.Optional }
            );

            routes.MapRoute(
                "Installer", // Route name
                "Installer/{action}/{key}", // URL with parameters
                new { controller = "Installer", action = "", key = UrlParameter.Optional }
            );

            //the route controller is the "catch all"
            routes.MapRoute(
                "Route", // Route name
                "{*name}", // URL with parameters
                new { controller = "Route", action = "Index" } // Parameter defaults
            );

            if (ConfigurationManager.AppSettings.GetSetting("EnableRouteDebug", false))
                RouteDebug.RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes);
        }
开发者ID:jonhenning,项目名称:videre,代码行数:28,代码来源:Global.asax.cs

示例14: Register

        public static void Register(RouteCollection routes)
        {
            // Turns off the unnecessary file exists check
            routes.RouteExistingFiles = true;

            // Ignore API pathways
            routes.IgnoreRoute("api/{*pathInfo}");

            // Ignore axd files such as assest, image, sitemap etc
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            //Exclude favicon (google toolbar request gif file as fav icon)
            routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.([iI][cC][oO]|[gG][iI][fF])(/.*)?" });

            // Ignore the content directories which contains images, scripts, & css
            routes.IgnoreRoute("Content/{*pathInfo}");
            routes.IgnoreRoute("Scripts/{*pathInfo}");

            routes.MapRoute("Search", "search", new { controller = "Search", action = "Index" });

            routes.MapRoute("Category", "{category}", new { controller = "Home", action = "Category" });
            routes.MapRoute("Entry", "{category}/{title}-{id}", new { controller = "Home", action = "Entry" }, new { id = @"\d+" });
            routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional });

            // Ignore status, html, xml files.
            routes.IgnoreRoute("{file}.ashx");
            routes.IgnoreRoute("{file}.txt");
            routes.IgnoreRoute("{file}.htm");
            routes.IgnoreRoute("{file}.html");
            routes.IgnoreRoute("{file}.xml");
        }
开发者ID:supportify,项目名称:demo-asp-mvc,代码行数:31,代码来源:RegisterRoutes.cs

示例15: RegisterRoutes

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

            routes.IgnoreRoute("favicon.ico");

            routes.MapRoute(
                "Archives",
                "Archives",
                new { controller = "Page", action = "Index", }
            );

            routes.MapRoute(
                "Feed",
                "Feed",
                new { controller = "Wiki", action = "Feed", }
            );

            routes.MapRoute(
                "Wiki",
                "{title}",
                new { controller = "Wiki", action = "Details", title = "Home" }
            );

            routes.MapRoute(
                "Default",
                "{controller}/{action}/{id}",
                new { controller = "Page", action = "Index", id = UrlParameter.Optional }
            );
        }
开发者ID:daruyanagi,项目名称:Daruboard,代码行数:30,代码来源:Global.asax.cs


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