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


C# RouteCollection.MapContentRoute方法代码示例

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


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

示例1: GenericContentRoute_IsntPushedBackBy_ContentRoute

        public void GenericContentRoute_IsntPushedBackBy_ContentRoute()
        {
            RouteCollection rc = new RouteCollection();
            rc.MapContentRoute<Models.RegularPage>("area", MockRepository.GenerateStub<IEngine>());
            rc.MapContentRoute("content", MockRepository.GenerateStub<IEngine>());

            Assert.That(rc.Count, Is.EqualTo(2));
            Assert.That(rc.First(), Is.InstanceOf<ContentRoute<Models.RegularPage>>());
            Assert.That(rc.Skip(1).First(), Is.InstanceOf<ContentRoute>());
        }
开发者ID:Biswo,项目名称:n2cms,代码行数:10,代码来源:MapContentRouteTests.cs

示例2: ContentRoute_IsInsertedBetween_OtherContentRoutes_AndNonContentRoute

        public void ContentRoute_IsInsertedBetween_OtherContentRoutes_AndNonContentRoute()
        {
            RouteCollection rc = new RouteCollection();
            rc.MapRoute("mvc", "{controller}/{action}");
            rc.MapContentRoute<Models.RegularPage>("area", MockRepository.GenerateStub<IEngine>());
            rc.MapContentRoute("content", MockRepository.GenerateStub<IEngine>());

            Assert.That(rc.Count, Is.EqualTo(3));
            Assert.That(rc.First(), Is.InstanceOf<ContentRoute<Models.RegularPage>>());
            Assert.That(rc.Skip(1).First(), Is.InstanceOf<ContentRoute>());
        }
开发者ID:Biswo,项目名称:n2cms,代码行数:11,代码来源:MapContentRouteTests.cs

示例3: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            L24Manager.Init(routes, typeof(HomeController));
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapContentRoute(
                "BlogPost", "Blog/{Year}/{Month}/{Day}/{Name}",
                new { controller = "BlogPost", action = "Index" });

            routes.MapContentRoute(
                "Default", // Route name
                "{controller}/{action}", // URL with parameters
                new { controller = "Home", action = "Index" } // Parameter defaults
            );
        }
开发者ID:jamesej,项目名称:TheWebPartnership,代码行数:15,代码来源:Global.asax.cs

示例4: ContentRoute_IsAdded

        public void ContentRoute_IsAdded()
        {
            RouteCollection rc = new RouteCollection();
            rc.MapContentRoute("content", MockRepository.GenerateStub<IEngine>());

            Assert.That(rc.Count, Is.EqualTo(1));
            Assert.That(rc.First(), Is.InstanceOf<ContentRoute>());
        }
开发者ID:Biswo,项目名称:n2cms,代码行数:8,代码来源:MapContentRouteTests.cs

示例5: ContentRoute_IsInsertedBefore_NonContentRoute

        public void ContentRoute_IsInsertedBefore_NonContentRoute()
        {
            RouteCollection rc = new RouteCollection();
            rc.MapRoute("mvc", "{controller}/{action}");
            rc.MapContentRoute("content", MockRepository.GenerateStub<IEngine>());

            Assert.That(rc.Count, Is.EqualTo(2));
            Assert.That(rc.First(), Is.InstanceOf<ContentRoute>());
        }
开发者ID:Biswo,项目名称:n2cms,代码行数:9,代码来源:MapContentRouteTests.cs

示例6: RegisterRoutes

		public static void RegisterRoutes(RouteCollection routes, IEngine engine)
		{
			routes.MapContentRoute("Content", engine);

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

示例7: RegisterRoutes

 public static void RegisterRoutes(RouteCollection routes, IEngine engine)
 {
     routes.MapContentRoute("Content", engine);
     routes.MapRoute("DefaultCss",
                     "DefaultCss",
                     new
                     {
                         controller = "StartPage",
                         action = "DefaultCss"
                     });
 }
开发者ID:pauldotknopf,项目名称:N2Bootstrap,代码行数:11,代码来源:Starter.cs

示例8: RegisterRoutes

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

            routes.MapContentRoute("Content", engine);

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

示例9: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes, IEngine engine)
        {
            AreaRegistration.RegisterAllAreas(new AreaRegistrationState(engine));

            routes.MapContentRoute("Content", engine);
            routes.MapRoute("Forum", "Forum",
                new { controller = "RedirectToUrl", action = "RedirectToUrl", url = "http://forum.tigersnetball.co.uk" });

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

示例10: RegisterRoutes

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

            // This route detects content item paths and executes their controller
            routes.MapContentRoute("Content", engine);

            // This controller fallbacks to a controller unrelated to N2
            routes.MapRoute(
               "Default",                                              // Route name
               "{controller}/{action}/{id}",                           // URL with parameters
               new { controller = "Home", action = "Index", id = UrlParameter.Optional }  // Parameter defaults
            );
        }
开发者ID:Davgus,项目名称:El,代码行数:14,代码来源:Global.asax.cs

示例11: RegisterRoutes

		public static void RegisterRoutes(RouteCollection routes, IEngine engine)
		{
			routes.MapContentRoute("Content", engine);
		}
开发者ID:grbbod,项目名称:drconnect-jungo,代码行数:4,代码来源:GlobalMvcStarter.cs

示例12: RegisterRoutes

 public static void RegisterRoutes(RouteCollection routes, IEngine engine)
 {
     // The content route routes firndly urls based onthe content structure
     routes.MapContentRoute("Content", engine);
 }
开发者ID:competentninja,项目名称:n2cms-website,代码行数:5,代码来源:CmsConfig.cs

示例13: RegisterRoutes

 public static void RegisterRoutes(RouteCollection routes)
 {
     routes.MapContentRoute("Content", N2.Context.Current);
 }
开发者ID:Davgus,项目名称:El,代码行数:4,代码来源:Global.asax.cs

示例14: RegisterArea

 public virtual void RegisterArea(RouteCollection routes, ViewEngineCollection viewEngines, IEngine engine)
 {
     var route = routes.MapContentRoute<IManagementHomePart>("Management", engine);
     var viewLocationFormats = new[] { Url.ResolveTokens("{ManagementUrl}/Myself/Analytics/Views/{1}/{0}.ascx"), Url.ResolveTokens("{ManagementUrl}/Myself/Analytics/Views/Shared/{0}.ascx") };
     viewEngines.Insert(0, new PrivateViewEngineDecorator(new WebFormViewEngine { AreaViewLocationFormats = viewLocationFormats, PartialViewLocationFormats = viewLocationFormats }, route));
 }
开发者ID:GrimaceOfDespair,项目名称:n2cms,代码行数:6,代码来源:ManagementAreaRegistration.cs

示例15: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {

            routes.IgnoreRoute("Content/{*pathInfo}");
            routes.IgnoreRoute("Scripts/{*pathInfo}");
            routes.IgnoreRoute("Styles/{*pathInfo}");

            routes.IgnoreRoute("{*sosa}", new { font = @"(.*/)?sosa.(/.*)?" });
            routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.([iI][cC][oO]|[gG][iI][fF])(/.*)?" });

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


            routes.MapRoute(
                "N2Diagnostics",
                "Diagnostic/{action}/{id}",
                new { controller = "Diagnostic", action = "Index", id = UrlParameter.Optional });

            routes.MapRoute(
                "RestrictedAdmin",
                "Restricted/Admin/{action}/{id}",
                new { controller = "Admin", action = "Index", id = UrlParameter.Optional });

            routes.MapRoute(
                "Sitemap1",
                "sitemap.xml",
                new { controller = "Sitemap", action = "Index" }
            );

            routes.MapRoute(
                "Sitemap2",
                "{siteId}/sitemap.xml",
                new { controller = "Sitemap", action = "Index" }
            );

            routes.MapRoute(
                "Sitemap3",
                "{siteId}/{cultureCode}/sitemap.xml",
                new { controller = "Sitemap", action = "Index" }
            );

            // n2cms content route
            routes.MapContentRoute("CMS", N2.Context.Current, true);


            // Image Picker Controller: GetFiles method
            routes.MapRoute(
                "ImagePickerUploadFiles",
                "ImagePicker/UploadFile",
                new { controller = "ImagePicker", action = "UploadFile" } // Parameter defaults
            );

            // Image Picker Controller: GetFiles method

            routes.MapRoute(
                "ImagePickerGetFiles",
                "ImagePicker/GetFiles",
                new { controller = "ImagePicker", action = "GetFiles" } // Parameter defaults
            );

            // Image Picker Controller: Search method
            routes.MapRoute(
                "ImagePickerImageSearch",
                "ImagePicker/Search",
                new { controller = "ImagePicker", action = "Search" } // Parameter defaults
            );

            // Image Picker controller: Index method
            routes.MapRoute(
                "ImagePickerIndex",
                "ImagePicker/{id}",
                new { controller = "ImagePicker", action = "Index" }
                );

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

            routes.MapRoute(
                "ProductPickerProductSearch", // Route name
                "ProductPicker/SearchProducts/{keywords}/{page}/{pageSize}", // URL with parameters
                new { controller = "ProductPicker", action = "SearchProducts", page = UrlParameter.Optional, pageSize = UrlParameter.Optional } // Parameter defaults
                );

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

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

//.........这里部分代码省略.........
开发者ID:grbbod,项目名称:drconnect-jungo,代码行数:101,代码来源:RouteConfig.cs


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