示例#1
0
        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 });
        }
示例#2
0
        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 });
        }
示例#3
0
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "MiniSite_default",
                "MiniSite/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
                );

            context.MapLocalizedRoute(
                "MiniSiteHomePage",
                "",
                new { action = "Index", controller = "Home" },
                new { isLocal = new InnerHostConstraint() },
                new[] { "Nop.Web.Areas.MiniSite.Controllers" });

            context.MapLocalizedRoute(
                "MiniSiteNews",
                "news",
                new { action = "List", controller = "News" },
                new { isLocal = new InnerHostConstraint() },
                new[] { "Nop.Web.Areas.MiniSite.Controllers" });

            context.MapLocalizedRoute("CategorySelector",
                                      "Catalogue/GetSubCategories",
                                      new { controller = "Catalogue", action = "GetSubCategories", area = "MiniSite" },
                                      new { isLocal = new InnerHostConstraint() },
                                      new[] { "Nop.Web.Areas.MiniSite.Controllers" });

            context.MapLocalizedRoute("MiniCategoryItem",
                                      "Catalogue/{itemtype}/{SeName}",
                                      new { controller = "Catalogue", action = "Category", SeName = "all", area = "MiniSite" },
                                      new { itemtype = @"\S+", SeName = @"\S+", isLocal = new InnerHostConstraint() },
                                      new[] { "Nop.Web.Areas.MiniSite.Controllers" });

            context.MapLocalizedRoute(
                "MiniContacts",
                "Contacts",
                new { action = "Contacts", controller = "Common" },
                new { isLocal = new InnerHostConstraint() },
                new[] { "Nop.Web.Areas.MiniSite.Controllers" });

            context.MapLocalizedRoute("MiniTextPage",
                                      "t/{SeName}",
                                      new { controller = "Common", action = "TextPage", area = "MiniSite" },
                                      new { isLocal = new InnerHostConstraint() },
                                      new[] { "Nop.Web.Areas.MiniSite.Controllers" });
            context.Routes.IgnoreRoute("news/addnews", new { isLocal = new InnerHostConstraint() });
            context.Routes.IgnoreRoute("news/managenews", new { isLocal = new InnerHostConstraint() });
        }