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


C# AreaRegistrationContext.MapLocalizedRoute方法代码示例

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


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

示例1: RegisterArea

        public override void RegisterArea(AreaRegistrationContext context)
        {
            var culture = StrixPlatform.DefaultCultureCode.ToLower();

            context.Routes.MapRoute(
                "SecureFiles",
                "Content/Uploads/Secure/{*url}",
                new { controller = "File", action = "GetFile", type = "Uploads", url = UrlParameter.Optional });

            context.Routes.MapRoute(
                "SecureThumbs",
                "Content/Thumbs/Secure/{*url}",
                new { controller = "File", action = "GetFile", type = "Thumbs", url = UrlParameter.Optional });

            context.Routes.MapLocalizedRoute(
                "CheckName",
                "{language}/{controller}/CheckName/{name}/{entityId}",
                new { language = culture, controller = "Home", action = "CheckName", name = UrlParameter.Optional, entityId = UrlParameter.Optional });

            context.Routes.MapRoute(
                "Images",
                "Image/{width}/{height}/{*url}",
                new { controller = "File", action = "GetImage", type = "Thumbs", width = UrlParameter.Optional, height = UrlParameter.Optional, url = UrlParameter.Optional });

            context.MapLocalizedRoute(
                "EntityAction",
                "{language}/Admin/Cms/EntityAction/{action}/{id}",
                new { language = culture, controller = "EntityAction", action = MvcConstants.INDEX, id = UrlParameter.Optional });

            context.MapLocalizedRoute(
                "Versioning",
                "{language}/Admin/Version/{action}/{id}",
                new { language = culture, controller = "Version", action = MvcConstants.INDEX, id = UrlParameter.Optional });

            context.MapLocalizedRoute(
                name: "Cms_Default",
                url: "{language}/Admin/Cms/{controller}/{action}/{id}",
                defaults: new { language = culture, controller = "Home", action = "Index", id = UrlParameter.Optional });
        }
开发者ID:StrixIT,项目名称:StrixIT.Platform.Modules.Cms,代码行数:39,代码来源:CmsAreaRegistration.cs

示例2: RegisterArea

        public override void RegisterArea(AreaRegistrationContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            var culture = StrixPlatform.DefaultCultureCode.ToLower();

            context.MapLocalizedRoute(
                LoggingConstants.LOGGING,
                "{language}/Admin/Logging/{controller}/{action}/{id}",
                new { language = culture, controller = LoggingConstants.LOGGING, action = MvcConstants.INDEX, id = UrlParameter.Optional });
        }
开发者ID:StrixIT,项目名称:StrixIT.Platform.Modules.Logging,代码行数:14,代码来源:LoggingAreaRegistration.cs

示例3: RegisterArea

        public override void RegisterArea(AreaRegistrationContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            var culture = StrixPlatform.DefaultCultureCode.ToLower();

            context.MapLocalizedRoute(
                "Account_ResetLink",
                "{language}/Account/SendPasswordLink/{userId}",
                new { language = culture, controller = MembershipConstants.ACCOUNT, action = "SendPasswordLink", key = UrlParameter.Optional });

            context.MapLocalizedRoute(
                "Account_Default",
                "{language}/Account/{action}/{key}",
                new { language = culture, controller = MembershipConstants.ACCOUNT, action = MvcConstants.INDEX, key = UrlParameter.Optional });

            context.MapLocalizedRoute(
                "Membership_admin",
                "{language}/Admin/Membership/{controller}/{action}/{id}",
                new { language = culture, controller = "Base", action = MvcConstants.INDEX, id = UrlParameter.Optional });
        }
开发者ID:StrixIT,项目名称:StrixIT.Platform.Modules.Membership,代码行数:24,代码来源:MembershipAreaRegistration.cs


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