• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Mvc.AreaRegistrationContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Web.Mvc.AreaRegistrationContext的典型用法代码示例。如果您正苦于以下问题:C# AreaRegistrationContext类的具体用法?C# AreaRegistrationContext怎么用?C# AreaRegistrationContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AreaRegistrationContext类属于System.Web.Mvc命名空间,在下文中一共展示了AreaRegistrationContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: RegisterArea

        public override void RegisterArea(AreaRegistrationContext context)
        {
            // TRANSLATION ROUTING 
            CultureInfo cultureEN = CultureInfo.GetCultureInfo("en-US");
            CultureInfo cultureIT = CultureInfo.GetCultureInfo("it-IT");

            DictionaryRouteValueTranslationProvider translationProvider = new DictionaryRouteValueTranslationProvider(
                new List<RouteValueTranslation> {
                    //new RouteValueTranslation(cultureIT, "Document", "preventivi-commesse-tipografia"),
                    //new RouteValueTranslation(cultureIT, "ListEstimate", "elenco-documenti-centro-stampa"),
                    //new RouteValueTranslation(cultureIT, "CreateProduct", "inserimento-di-uno-stampato"),
                    //new RouteValueTranslation(cultureIT, "Error", "errore"),
                    //new RouteValueTranslation(cultureIT, "NoTaskEstimatedOnException", "manca-definizione-costo")
                }
            );

            context.MapTranslatedRoute(
                "Working_default",
                "working-area/{controller}/{action}/{id}",
                new { controller = "Working", action = "Index", id = UrlParameter.Optional },
                new { controller = translationProvider, action = translationProvider },
                true);

            //context.MapRoute(
            //    "Working_default",
            //    "Working/{controller}/{action}/{id}",
            //    new { action = "Index", id = UrlParameter.Optional }
            //);
        }
开发者ID:algola,项目名称:backup,代码行数:29,代码来源:WorkingAreaRegistration.cs


示例2: RegisterArea

        public override void RegisterArea(AreaRegistrationContext context)
        {
            RouteTable.Routes.LowercaseUrls = true;
            RouteTable.Routes.AppendTrailingSlash = true;

            //context.MapRoute(
            //    "Admin_editcategoryroute",
            //    "Admin/{controller}/{action}/{id}",
            //    new { controller = "AdminCategory", action = "Index", id = UrlParameter.Optional }
            //);
            //context.MapRoute(
            //    "Admin_edituserroute",
            //    "Admin/{controller}/{action}/{userId}",
            //    new { controller = "Admin", action = "Index", userId = UrlParameter.Optional }
            //);
            //context.MapRoute(
            //    "Admin_pagingroute",
            //    "Admin/{controller}/{action}/{page}",
            //    new { controller = "Account", action = "Index", page = UrlParameter.Optional }
            //);
            context.MapRoute(
                "Admin_defaultroute",
                "Admin/{controller}/{action}/{id}",
                new { controller = "Admin", action = "Index", id = UrlParameter.Optional }
            );
        }
开发者ID:huchao007,项目名称:mvcforum,代码行数:26,代码来源:AdminAreaRegistration.cs


示例3: RegisterArea

        public override void RegisterArea(AreaRegistrationContext context)
        {
            #region == Blog ==
            context.MapRoute(
                "Accounts_Blog_default",
                "Accounts/Blog/{action}",
                new { action = "Index", controller = "Blog" }
            );
            #endregion


            #region == Company ==
            context.MapRoute(
                "Accounts_Company_default",
                "Accounts/Company/{action}",
                new { action = "NewsList", controller = "Company" }
            );
            #endregion



            context.MapRoute(
                "Accounts_default",
                "Accounts/{action}",
                new { action = "Index",controller="Accounts" }
            );
        }
开发者ID:lvjialiang,项目名称:PlantEng,代码行数:27,代码来源:AccountsAreaRegistration.cs


示例4: RegisterArea

 public override void RegisterArea(AreaRegistrationContext context)
 {
     //index
     context.MapRoute(
         "AdminArea_Index",
         "adminarea/index.html",
         new
         {
             action = "index",
             controller = "home"
         },
         new[] { "Icode.Blog.Web.Areas.AdminArea.Controllers" }
     );
     //默认路由
     context.MapRoute(
         "AdminArea_default",
         "adminarea/{controller}_{action}.html",
         new
         {
             action = "index",
             controller = "home"
         },
         new[] { "Icode.Blog.Web.Areas.AdminArea.Controllers" }
     );
 }
开发者ID:haoxilu,项目名称:IcodeBlog,代码行数:25,代码来源:AdminAreaAreaRegistration.cs


示例5: RegisterArea

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "AdminAlbumList",
                "Admin/Album/List",
                new { controller = "AdminAlbumController", action = "List", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "AdminAlbumCreate",
                "Admin/Album/Create",
                new { controller = "AlbumController", action = "Create", id = UrlParameter.Optional }
               );

            context.MapRoute(
                "AdminAlbumEdit",
                "Admin/Album/Edit/{id}",
                new { controller = "AdminAlbumController", action = "Edit", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "AdminAlbumDelete",
                "Admin/Album/Delete/{id}",
                new { controller = "AdminAlbumController", action = "Delete" }
            );

            context.MapRoute(
                "Admin_default",
                "Admin/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );
        }
开发者ID:N7i,项目名称:NwdStudents,代码行数:32,代码来源:AdminAreaRegistration.cs


示例6: RegisterArea

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                null,
                url: "Error",
                defaults: new { controller = "Error", action = "Index", id = UrlParameter.Optional },
                namespaces: new[] { "LessonProject.Areas.Default.Controllers" }
            );

            context.MapRoute(
                null,
                url: "NotFoundPage",
                defaults: new { controller = "Error", action = "NotFoundPage", id = UrlParameter.Optional },
                namespaces: new[] { "LessonProject.Areas.Default.Controllers" }
            );

            context.MapRoute(
                name: "lang",
                url: "{lang}/{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                constraints : new { lang = @"ru|en" },
                namespaces: new[] { "LessonProject.Areas.Default.Controllers" }
            );

            context.MapRoute(
                name : "default",
                url : "{controller}/{action}/{id}",
                defaults : new { controller = "Home", action = "Index", id = UrlParameter.Optional, lang = "ru" },
                namespaces : new [] { "LessonProject.Areas.Default.Controllers" }
            );
        }
开发者ID:jorik041,项目名称:lessons-asp-mvc,代码行数:31,代码来源:DefaultAreaRegistration.cs


示例7: RegisterArea

 public override void RegisterArea(AreaRegistrationContext context)
 {
     context.MapRoute(
       name: "Public_default",
         url: "{controller}/{action}/{id}",
         defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional });
 }
开发者ID:MariyaSteffanova,项目名称:EcoMaster,代码行数:7,代码来源:PublicAreaRegistration.cs


示例8: RegisterArea

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "AdminIdeasRoute",
                "Ideas/Admin/{action}/{id}",
                new { controller = "AdminIdeas", action = "Index", id = UrlParameter.Optional },
                new[] { "SampArch.Presentation.Area.Ideas.Controllers" }

            );

            context.MapRoute(
                "IdeasRoute",
                "Ideas/{action}/{id}",
                new { controller = "SiteIdeas", action = "Index", id = UrlParameter.Optional },
                new[] { "SampArch.Presentation.Area.Ideas.Controllers" }

            );

            context.MapRoute(
                "IdeasServiceRoute",
                "IdeasService/{action}/{id}",
                new { controller = "IdeasService", action = "DownloadCsv", id = UrlParameter.Optional },
                new[] { "SampArch.Presentation.Area.Ideas.Controllers" }

            );
        }
开发者ID:rhwy,项目名称:SampArch,代码行数:26,代码来源:IdeaAreaRegistration.cs


示例9: CuiAreaRegistration_RegisterArea_CuiRouteAdded_DataTokensSet

        public void CuiAreaRegistration_RegisterArea_CuiRouteAdded_DataTokensSet()
        {
            // arrange
            const string areaName = "CUI";
            const string routeName = "CUI_default";

            RouteCollection routes = new RouteCollection();
            AreaRegistrationContext context = new AreaRegistrationContext(areaName, routes); 
            var registration = new CuiAreaRegistration();
            
            // act
            registration.RegisterArea(context);

            // assert
            var route = context.Routes[routeName] as Route;
            
            Assert.IsNotNull(route);
            Assert.AreEqual("CUI/{controller}/{action}/{id}", route.Url);
            Assert.AreEqual("Main", route.Defaults["controller"]);
            Assert.AreEqual("Index", route.Defaults["action"]);
            Assert.AreEqual(areaName, route.Defaults["area"]);
            Assert.AreEqual(UrlParameter.Optional, route.Defaults["id"]);
            Assert.AreEqual("Login", route.DataTokens["LoginController"]);
            Assert.AreEqual("Index", route.DataTokens["LoginAction"]);
            Assert.AreEqual(areaName, registration.AreaName);
            Assert.AreEqual(areaName, context.AreaName);
        }
开发者ID:Exclr8,项目名称:CloudCore,代码行数:27,代码来源:CuiAreaRegistrationTests.cs


示例10: RegisterArea

 public override void RegisterArea(AreaRegistrationContext context)
 {
     context.MapRoute(
         name: AreaName + "-Default",
         url: "admin/raven/{action}/{id}",
         defaults: new { controller = "RavenAdmin", action = "Index", id = UrlParameter.Optional });
 }
开发者ID:jalchr,项目名称:brnkly,代码行数:7,代码来源:RavenAreaRegistration.cs


示例11: RegisterArea

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                   "ForumHome",
                   "Forum/Home",
                   new { controller = "Home", action = "Index" },
                   new[] { "EstateSocialSystem.Web.Controllers" });

            context.MapRoute(
                "ForumLogOff",
                "Forum/Account/LogOff",
                new { controller = "Account", action = "LogOff" },
                new[] { "EstateSocialSystem.Web.Controllers" });

            context.MapRoute(
                "Get questions by tag",
                "questions/tagged/{tag}",
                new { controller = "Questions", action = "GetByTag" },
                new[] { "EstateSocialSystem.Web.Areas.Forum.Controllers" });

            context.MapRoute(
                "Display question",
                "questions/{id}",
                new { controller = "Questions", action = "Display" },
                new[] { "EstateSocialSystem.Web.Areas.Forum.Controllers" });

            context.MapRoute(
                "Forum_default",
                "Forum/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional },
                new[] { "EstateSocialSystem.Web.Areas.Forum.Controllers" }
            );
        }
开发者ID:Georgegig,项目名称:EstateSocialSystem,代码行数:33,代码来源:ForumAreaRegistration.cs


示例12: RegisterArea

 protected override void RegisterArea(
     AreaRegistrationContext context,
     IApplicationBus bus,
     PlatformAreaRegistrationState state)
 {
     this.RegisterApplicationRoutes(context);
 }
开发者ID:paulkearney,项目名称:brnkly,代码行数:7,代码来源:AdministrationAreaRegistration.cs


示例13: RegisterApplicationRoutes

 protected void RegisterApplicationRoutes(AreaRegistrationContext context)
 {
     context.MapRoute(
         "AdminHome-Default",
         "",
         new { controller = "Admin", action = "Index" });
 }
开发者ID:paulkearney,项目名称:brnkly,代码行数:7,代码来源:AdministrationAreaRegistration.cs


示例14: RegisterArea

 public override void RegisterArea(AreaRegistrationContext context)
 {
     Config config = Config.Load();
     context.MapSubdomainRoute(
          "Error.Http404", // Route name
          new List<string>() { "*", "error" }, // Subdomains
          new List<string>() { config.Host }, // domains
          "404",    // URL with parameters 
          new { controller = "Error", action = "Http404" },  // Parameter defaults 
          new[] { typeof(Controllers.ErrorController).Namespace }
      );
     context.MapSubdomainRoute(
          "Error.Http403", // Route name
          new List<string>() { "*", "error" }, // Subdomains
          new List<string>() { config.Host }, // domains
          "403",    // URL with parameters 
          new { controller = "Error", action = "Http403" },  // Parameter defaults 
          new[] { typeof(Controllers.ErrorController).Namespace }
      );
     context.MapSubdomainRoute(
          "Error.Http500", // Route name
          new List<string>() { "*", "error" }, // Subdomains
          new List<string>() { config.Host }, // domains
          "500",    // URL with parameters 
          new { controller = "Error", action = "Http500" },  // Parameter defaults 
          new[] { typeof(Controllers.ErrorController).Namespace }
      );
 }
开发者ID:Teknikode,项目名称:Teknik,代码行数:28,代码来源:ErrorAreaRegistration.cs


示例15: RegisterArea

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                name: "Forums_default",
                url: "Forums",
                defaults: new
                {
                    controller = "Home",
                    action = "Index"
                },
                namespaces: new[] { "Zanshin.Areas.Forums.Controllers" });

            context.MapRoute(name: "Topic_Default",
                url: "Forums/{forumId}",
                defaults: new
                {
                    controller = "Home",
                    action = "Topics",
                    forumId = UrlParameter.Optional
                }, namespaces: new[] { "Zanshin.Areas.Forums.Controllers" });

            context.MapRoute(name: "Posts_default",
                url: "Forums/Posts/{topicId}",
                defaults: new
                {
                    controller = "Home",
                    action = "Posts",
                    topicId = UrlParameter.Optional
                }, namespaces: new[] { "Zanshin.Areas.Forums.Controllers" });
        }
开发者ID:shoff,项目名称:zanshin,代码行数:30,代码来源:ForumsAreaRegistration.cs


示例16: RegisterArea

 public override void RegisterArea(AreaRegistrationContext context)
 {
     var route = context.Routes.MapHttpRoute(name: "WindowsAuthArea", routeTemplate: "api/" + this.AreaName + "/{controller}/{id}", defaults: new { id = RouteParameter.Optional });
     if (route.DataTokens == null)
         route.DataTokens = new System.Web.Routing.RouteValueDictionary();
     route.DataTokens["area"] = this.AreaName;
 }
开发者ID:koder05,项目名称:fogel-ba,代码行数:7,代码来源:WindowsAuthArea.cs


示例17: RegisterArea

        public override void RegisterArea(AreaRegistrationContext context)
        {
            //var metaweblogRoute = new Route("Contents/metaweblog", null, null, new MetaWeblogRouteHandler());
            //context.Routes.Add(metaweblogRoute);

            context.MapRoute(
                "Contents_default",
                "Contents/{controller}/{action}",///{repositoryName}/{name}
                new { action = "Index" }
                , null
                , new[] { "Kooboo.CMS.Web.Areas.Contents.Controllers", "Kooboo.Web.Mvc", "Kooboo.Web.Mvc.WebResourceLoader" }
            );

            Kooboo.Web.Mvc.Menu.MenuFactory.RegisterAreaMenu(AreaName, AreaHelpers.CombineAreaFilePhysicalPath(AreaName, "Menu.config"));
            Kooboo.Web.Mvc.WebResourceLoader.ConfigurationManager.RegisterSection(AreaName, AreaHelpers.CombineAreaFilePhysicalPath(AreaName, "WebResources.config"));

            #region RegisterPermissions
            var roleManager = Kooboo.CMS.Common.Runtime.EngineContext.Current.Resolve<RoleManager>();
            roleManager.AddPermission(Permission.Contents_SettingPermission);
            roleManager.AddPermission(Permission.Contents_SchemaPermission);
            roleManager.AddPermission(Permission.Contents_FolderPermission);
            roleManager.AddPermission(Permission.Contents_ContentPermission);
            roleManager.AddPermission(Permission.Contents_BroadcastingPermission);
            roleManager.AddPermission(Permission.Contents_WorkflowPermission);
            roleManager.AddPermission(Permission.Contents_SearchSettingPermission);
            roleManager.AddPermission(Permission.Contents_HtmlBlockPermission);
            roleManager.AddPermission(Permission.Sites_Settings_CreateSubSitePermission);
            #endregion

            base.RegisterArea(context);
        }
开发者ID:FordSoft,项目名称:CMS,代码行数:31,代码来源:ContentsAreaRegistration.cs


示例18: RegisterArea

        public override void RegisterArea(AreaRegistrationContext context)
        {
            var routeContraint = new UserRouteConstraint(DependencyResolver.Current.GetService<IUserRepository>());

            context.MapRoute(
            "Users_albums",
            "{username}/albums/{id}/{name}",
            new { controller = "albums", action = "name", id="id"},
            constraints: new
            {
                username = routeContraint,
            });

            context.MapRoute(
            "Users_date",
            "{username}/{year}/{month}/{day}",
            new { controller = "date", action = "Index", month = UrlParameter.Optional, day = UrlParameter.Optional },
            constraints: new
                {
                    username = routeContraint,
                    year = @"\d{4}"
                });

            context.MapRoute(
            "Users_media",
            "{username}/media/{id}",
            new { controller = "Media", action = "Index" },
            constraints: new { username = routeContraint });

            context.MapRoute(
                "Users_default",
                "{username}/{controller}/{action}/{id}",
                new {  controller = "index", action = "Index", id = UrlParameter.Optional },
                constraints: new { username = routeContraint });
        }
开发者ID:chuckconway,项目名称:momntz-legacy,代码行数:35,代码来源:UsersAreaRegistration.cs


示例19: RegisterArea

 public override void RegisterArea(AreaRegistrationContext context)
 {
     context.MapRoute(
         "Private_default",
         "Private/{controller}/{action}/{id}",
         new { controller = "Communities", action = "Index", id = UrlParameter.Optional });
 }
开发者ID:vesheff,项目名称:Neighbours,代码行数:7,代码来源:PrivateAreaRegistration.cs


示例20: AdministrationAreaRegistrationTests

        public AdministrationAreaRegistrationTests()
        {
            registration = new AdministrationAreaRegistration();
            context = new AreaRegistrationContext(registration.AreaName, new RouteCollection());

            registration.RegisterArea(context);
        }
开发者ID:zarinbal,项目名称:MVC5.Template,代码行数:7,代码来源:AdministrationAreaRegistrationTests.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Mvc.AuthorizationContext类代码示例发布时间:2022-05-26
下一篇:
C# Mvc.AjaxHelper类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap