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


C# RouteCollection.MapNavigationRoute方法代码示例

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


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

示例1: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapNavigationRoute<HomeController>("Home", c => c.Index(), "");
            routes.MapNavigationRoute<HomeController>("About", c => c.About(), "");
            routes.MapNavigationRoute<HomeController>("Contact", c => c.Contact(), "");
            /*
            //routes.MapNavigationRoute(""
            // this enables menu suppression for routes with a FilterToken of "admin" set
               // NavigationRoutes.NavigationRoutes.Filters.Add(new AdministrationRouteFilter());

            routes.MapNavigationRoute<HomeController>("Automatic Scaffolding", c => c.Index(), "",
                                                      new  {HasBreakAfter = true});

            // this route will only show if users are in the role specified in the AdministrationRouteFilter
            // by default, when you run the site, you will not see this. Explore the AdministrationRouteFilter
            // class for more information.
            routes.MapNavigationRoute<HomeController>("Administration Menu", c => c.Admin(), "",
                                                      new  { HasBreakAfter = true, FilterToken = "admin"});

            routes.MapNavigationRoute<ExampleLayoutsController>("Example Layouts", c => c.Starter())
                  .AddChildRoute<ExampleLayoutsController>("Marketing", c => c.Marketing())
                  .AddChildRoute<ExampleLayoutsController>("Fluid", c => c.Fluid(), new NavigationRouteOptions{ HasBreakAfter = true})
                  .AddChildRoute<ExampleLayoutsController>("Sign In", c => c.SignIn())
                ;*/
        }
开发者ID:coolcode,项目名称:iRhyme,代码行数:25,代码来源:ExampleLayoutsRouteConfig.cs

示例2: RegisterRoutes

 public static void RegisterRoutes(RouteCollection routes)
 {
     routes.MapNavigationRoute<CoordinatorController>("Create", c => c.Create());
     routes.MapNavigationRoute<CoordinatorController>("History", c => c.History(0, 20));
     routes.MapNavigationRoute("API", "api", "api");
     routes.MapNavigationRoute<HomeController>("Configuration", c => c.Configuration());
 }
开发者ID:Compassion,项目名称:SmsScheduler,代码行数:7,代码来源:LayoutsRouteConfig.cs

示例3: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            // this enables menu suppression for routes with a FilterToken of "admin" set
            NavigationRouteFilters.Filters.Add(new AdministrationRouteFilter());

            routes.MapNavigationRoute<HomeController>("Automatic Scaffolding", c => c.Index(), "", new NavigationRouteOptions {HasBreakAfter = true});

            // this route will only show if users are in the role specified in the AdministrationRouteFilter
            // by default, when you run the site, you will not see this. Explore the AdministrationRouteFilter
            // class for more information.
            routes.MapNavigationRoute<HomeController>("Administration Menu", c => c.Admin(), "", new NavigationRouteOptions { HasBreakAfter = true, FilterToken = "admin"});

            routes.MapNavigationRoute<ExampleLayoutsController>("Bootstrap Layouts", c => c.Null())
                  .AddChildRoute<ExampleLayoutsController>("Marketing", c => c.Marketing())
                  .AddChildRoute<ExampleLayoutsController>("Fluid", c => c.Fluid(), new NavigationRouteOptions{ HasBreakAfter = true})
                  .AddChildRoute<ExampleLayoutsController>("Sign In", c => c.SignIn());

            routes.MapNavigationRoute<GridController>("JS Grids", c => c.Null())
                .AddChildRoute<GridController>("jqGrid", c => c.JQGrid())
                .AddChildRoute<GridController>("DataTables", c => c.DataTable())
                .AddChildRoute<GridController>("SlickGrid", c => c.SlickGrid());

            routes.MapNavigationRoute<FrameworkController>("JS Frameworks", c => c.Null())
                .AddChildRoute<FrameworkController>("AngularJS", c => c.AngularJS())
                .AddChildRoute<FrameworkController>("KnockoutJS", c => c.KnockoutJS());
        }
开发者ID:stephenpatten,项目名称:net.stephenpatten,代码行数:26,代码来源:BootstrapRouteConfig.cs

示例4: RegisterRoutes

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

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

            //routes.MapNavigationRoute<ExampleLayoutsController>("Bootstrap Layouts", c => c.Starter())
            //      .AddChildRoute<ExampleLayoutsController>("Marketing", c => c.Marketing())
            //      .AddChildRoute<ExampleLayoutsController>("Fluid", c => c.Fluid())
            //      .AddChildRoute<ExampleLayoutsController>("Sign In", c => c.SignIn())
            //    ;
            //routes.MapNavigationRoute<HomeController>("Home", c => c.Index())
            //      .AddChildRoute<AccountController>("Sign In", c => c.Login("home/index"))
            //      .AddChildRoute<HomeController>("About", c => c.About())
            //      ;

            //routes.MapNavigationRoute<HomeController>("Manage", c => c.Index())
            //      .AddChildRoute<ChannelsController>("Channels", c => c.Index())
            //      .AddChildRoute<BroadcastsController>("Broadcasts", c => c.Index());

            routes.MapNavigationRoute<BroadcastsController>("My Broadcasts", c => c.IndexMy());

            routes.MapNavigationRoute<ChannelsController>("Channels", c => c.Index());
            routes.MapNavigationRoute<BroadcastsController>("Broadcasts", c => c.Index());
            routes.MapNavigationRoute<UserInfoesController>("Users", c => c.Index());
        }
开发者ID:sgolodychenko,项目名称:1stream,代码行数:30,代码来源:RouteConfig.cs

示例5: RegisterRoutes

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

            routes.MapNavigationRoute("Home", "", new {controller = "Home", action = "Index"});
            routes.MapNavigationRoute("About", "about", new {controller = "Home", action = "About"});
            routes.MapNavigationRoute("Contact", "contact", new {controller = "Home", action = "Contact"});
        }
开发者ID:mhinze,项目名称:fuzzy-tyrion,代码行数:8,代码来源:Global.asax.cs

示例6: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapNavigationRoute<HomeController>("Home", c => c.Index());

            routes.MapNavigationRoute<PersonController>("People", c => c.Null())
                .AddChildRoute<PersonController>("View All", c => c.Index())
                .AddChildRoute<PersonController>("Create New", c => c.Create());
        }
开发者ID:nilghe,项目名称:MvcMovieFu,代码行数:8,代码来源:ExampleLayoutsRouteConfig.cs

示例7: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapNavigationRoute<HomeController>("Home", c => c.Index());

            routes.MapNavigationRoute<AdminController>("Admin", c => c.Details(Guid.NewGuid()))
                .AddChildRoute<AdminController>("List Recipes", c => c.Index())
               .AddChildRoute<AdminController>("Create Recipe", c => c.Create(null));
        }
开发者ID:emanuelgidar,项目名称:RecipesMVC4,代码行数:8,代码来源:ExampleLayoutsRouteConfig.cs

示例8: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapNavigationRoute<DiskController>("My Disk", c => c.Index());

            routes.MapNavigationRoute<AccountController>("Profile", c => c.Index())
                  .AddChildRoute<AccountController>("Sign Out", c => c.LogOut())
                ;
        }
开发者ID:kmiloaguilar,项目名称:progra4-minidropbox,代码行数:8,代码来源:ExampleLayoutsRouteConfig.cs

示例9: RegisterRoutes

 public static void RegisterRoutes(RouteCollection routes)
 {
     routes.MapNavigationRoute<HomeController>("Best Days", c => c.BestDays());
       routes.MapNavigationRoute<HomeController>("Cities", c => c.Cities());
       routes.MapNavigationRoute<HomeController>("Mobile", c => c.TopLocal());
       routes.MapNavigationRoute<HomeController>("Blog", c => c.Contact());
       routes.MapNavigationRoute<HomeController>("Team", c => c.About());
 }
开发者ID:jmoral4,项目名称:scoutabout,代码行数:8,代码来源:ExampleLayoutsRouteConfig.cs

示例10: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapNavigationRoute("Blog-navigation", "Blog", "blog", new { controller = "Blog", action = "Index" });

            foreach (var pageMetadata in PagesMetadata.Instance.List)
            {
                routes.MapNavigationRoute("Page-navigation-" + pageMetadata.Slug, pageMetadata.Title, pageMetadata.Slug, new { controller = "Page", action = "GetPage" });
            }
        }
开发者ID:nickmeldrum,项目名称:nickmeldrum.com.markdownblog,代码行数:9,代码来源:BlogRouteConfig.cs

示例11: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapNavigationRoute<HomeController>("Automatic Scaffolding", c => c.Index());

            routes.MapNavigationRoute<ExampleLayoutsController>("Example Layouts", c => c.Starter())
                  .AddChildRoute<ExampleLayoutsController>("Marketing", c => c.Marketing())
                  .AddChildRoute<ExampleLayoutsController>("Fluid", c => c.Fluid())
                  .AddChildRoute<ExampleLayoutsController>("Sign In", c => c.SignIn())
                ;
        }
开发者ID:eduardoluizm,项目名称:QueroTrocarMeuLivro,代码行数:10,代码来源:ExampleLayoutsRouteConfig.cs

示例12: RegisterRoutes

 public static void RegisterRoutes(RouteCollection routes)
 {
     routes.MapNavigationRoute<SmsAndEmailController>("Create", c => c.Create());
     routes.MapNavigationRoute<CoordinatorController>("History", c => c.History(0, 20));
     //            routes.MapNavigationRoute<CoordinatorController>("Create", c => c.Create());
     //            routes.MapNavigationRoute<CoordinatorController>("History", c => c.History(0, 20));
     routes.MapNavigationRoute("API", "api", "api");
     routes.MapNavigationRoute<CommunicationTemplateController>("Templates", c => c.Index());
     routes.MapNavigationRoute<HomeController>("Configuration", c => c.Configuration());
 }
开发者ID:samjeffress,项目名称:TrickleComms,代码行数:10,代码来源:LayoutsRouteConfig.cs

示例13: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapNavigationRoute<HomeController>("首页", c => c.Index());

            routes.MapNavigationRoute<ExampleLayoutsController>("Admin", c => c.Starter())
                  .AddChildRoute<UserController>("个人设置", c => c.Setting())
                  .AddChildRoute<UserController>("密码修改", c => c.Password())
                  .AddChildRoute<UserController>("退出登录", c => c.LogOff())
                ;
        }
开发者ID:kamaelyoung,项目名称:MVCScaffold-And-Bootstrap,代码行数:10,代码来源:ExampleLayoutsRouteConfig.cs

示例14: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapNavigationRoute<AccountController>("Inicio", c => c.LogIn());

            routes.MapNavigationRoute<ExampleLayoutsController>("Perfil", c => c.Starter())
                  .AddChildRoute<DiskController>("Lista Archivos", c => c.ListAllContent())
                  .AddChildRoute<AccountController>("Editar Perfil", c => c.UpdateProfile())
                  .AddChildRoute<AccountController>("Referral a friend", c => c.Referral())
                ;
        }
开发者ID:Edalzebu,项目名称:MiniDropbox,代码行数:10,代码来源:ExampleLayoutsRouteConfig.cs

示例15: RegisterRoutes

        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapNavigationRoute<HomeController>("Home Dashboard", c => c.Index());
            routes.MapNavigationRoute<RenterController>("Tenants", c => c.Index());

            routes.MapNavigationRoute<ExampleLayoutsController>("Example Layouts", c => c.Starter())
                  .AddChildRoute<ExampleLayoutsController>("Marketing", c => c.Marketing())
                  .AddChildRoute<ExampleLayoutsController>("Fluid", c => c.Fluid())
                  .AddChildRoute<ExampleLayoutsController>("Sign In", c => c.SignIn())
                ;
        }
开发者ID:gcwolfe007,项目名称:mmMVC_soln,代码行数:11,代码来源:ExampleLayoutsRouteConfig.cs


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