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" }
     );
 }
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "User_ajax",
                "user/ajax/{action}/{id}",
                new {
                    controller = "UserAjax",
                    id = UrlParameter.Optional
                }
            );

            context.MapRoute(
                "User_token",
                "User/{token}",
                new { controller = "UserToken" },
                new { token = @"^\{[0-9A-Fa-f]{8}\-([0-9A-Fa-f]{4}\-){3}[0-9A-Fa-f]{12}\}$" }
            );

            context.MapRoute(
                "User_main",
                "User/{action}",
                new { controller = "User" }
            );

            context.MapRoute(
                "User_default",
                "User/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );
        }
Exemplo n.º 3
0
 public override void RegisterArea(AreaRegistrationContext context)
 {
     context.MapRoute("", "shopping", new { area = "Shop", controller = "Shop", action = "Shopping" });
     context.MapRoute("", "products", new { area = "Shop", controller = "Shop", action = "Products" });
     context.MapRoute("", "products/{id}", new { area = "Shop", controller = "Shop", action = "Product" });
     context.MapRoute("", "search", new { area = "Shop", controller = "Shop", action = "Search" });
 }
Exemplo n.º 4
0
        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 }
            );
        }
        public override void RegisterArea(AreaRegistrationContext context)
        {

            context.MapRoute(
             "DesignerDetails",
             "to/{id}",
             new { controller = "Designer", action = "Details" }
            );

            context.MapRoute(
             "DesignerLogon",
             "to/{id}/logon",
             new { controller = "Designer", action = "LogOn" }
            );

            context.MapRoute(
             "DesignerRoomDetails",
             "to/{id}/living",
             new { controller = "Designer", action = "RoomDetails", roomType=1 }
            );

            context.MapRoute(
             "DesignerRoomDetails1",
             "to/{id}/notliving",
             new { controller = "Designer", action = "RoomDetails", roomType = 2 }
            );


            context.MapRoute(
                "DesignersPortfolio_default",
                "to/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );
        }
        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" }
            );
        }
Exemplo n.º 7
0
        /// <summary>
        /// Registers an area in an ASP.NET MVC application using the specified area's context information.
        /// </summary>
        /// <param name="context">Encapsulates the information that is required in order to register the area.</param>
        public override void RegisterArea(AreaRegistrationContext context)
        {
            ViewEngines.Engines.Add(new RazorViewEngine
            {
                AreaPartialViewLocationFormats = new[] { "~/Areas/NAd.Web.UI.Core/Views/{1}/{0}.cshtml", "~/Areas/BrickPile.UI/Views/Shared/{0}.cshtml" },
                AreaMasterLocationFormats = new[] { "~/Areas/NAd.Web.UI.Core/Views/{1}/{0}.cshtml" },
                AreaViewLocationFormats = new[] { "~/Areas/NAd.Web.UI.Core/Views/{1}/{0}.cshtml" }
            });

            //var dashboardRoute = new ContentRoute(
            //    ObjectFactory.GetInstance<DashboardPathResolver>(),
            //    ObjectFactory.GetInstance<DashboardVirtualPathResolver>(),
            //    null);

            //context.Routes.Add("Dashboard", dashboardRoute);

            context.MapRoute(
                "Dashboard_publish",
                "dashboard/content/publish/{id}/{published}",
                new { controller = "content", action = "publish", Area = "dashboard" }
            );

            context.MapRoute(
                "Dashboard_default",
                "dashboard/{controller}/{action}/{id}",
                new { controller = "dashboard", action = "index", id = UrlParameter.Optional }
            );
        }
 public override void RegisterArea(AreaRegistrationContext context)
 {
     context.MapRoute(
         "Dashboard_elmah",
         "Dashboard/elmah/{type}",
         new { action = "Index", controller = "Elmah", type = UrlParameter.Optional }
     );
     context.MapRoute(
         "Dashboard_default",
         "Dashboard/",
         new { controller = "Dashboard", action = "Home"},
         new string[] { "Portfolio.Areas.Dashboard.Controllers" }
     );
     context.MapRoute(
         "Dashboard_account",
         "Dashboard/My-Account/{action}",
         new { controller = "AccountUser", action = "Edit" },
         new string[] { "Portfolio.Areas.Dashboard.Controllers" }
     );
     context.MapRoute(
         "Dashboard_digital_portfolio",
         "Dashboard/Digital-Portfolio/{action}/{id}",
         new { controller = "DigitalPortfolio", action = "Index", id = UrlParameter.Optional },
         new string[] { "Portfolio.Areas.Dashboard.Controllers" }
     );
     context.MapRoute(
         "Dashboard_routes",
         "Dashboard/{controller}/{action}/{id}",
         new { action = "Index", id = UrlParameter.Optional },
         new string[] { "Portfolio.Areas.Dashboard.Controllers" }
     );
 }
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "Search_default",
                "Search",
                new { controller = "Search", action = "ProcessSearchFormInput", id = UrlParameter.Optional, area = "Search" },
                new[] { "Destination2.WebUi.Search.Controllers" }
            );

            context.MapRoute(
                "PackageSerarchWaitFlight",
                "Search/Package-Flight-Wait",
                new { controller = "Wait", action = "FlightWait", id = UrlParameter.Optional, area = "Search" },
                new[] { "Destination2.WebUi.Search.Controllers" }
            );

            context.MapRoute(
                "PackageSerarchWaitFlightSearchStart",
                "Search/Package-Flight-Start",
                new { controller = "Wait", action = "FlightSearchStart", id = UrlParameter.Optional, area = "Search" },
                new[] { "Destination2.WebUi.Search.Controllers" }
            );

            context.MapRoute(
               "PackageSearchWaitFlightSearchStart",
               "Search/Package-Flight-Results",
               new { controller = "Results", action = "FlightResults", id = UrlParameter.Optional, area = "Search" },
               new[] { "Destination2.WebUi.Search.Controllers" }
               );
        }
        public override void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
        {
            var currentState = (PortableAreaUtils.RegistrationState)Enum.Parse(typeof(PortableAreaUtils.RegistrationState), context.State.ToString());

            if (currentState == PortableAreaUtils.RegistrationState.Initializing) {
                context.MapRoute("Appleseed.Core_ResourceRoute", "Appleseed.Core/resource/{resourceName}",
                   new { controller = "EmbeddedResource", action = "Index" },
                   new string[] { "MvcContrib.PortableAreas" });

                context.MapRoute("Appleseed.Core_ResourceImageRoute", "Appleseed.Core/images/{resourceName}",
                  new { controller = "EmbeddedResource", action = "Index", resourcePath = "images" },
                  new string[] { "MvcContrib.PortableAreas" });

                context.MapRoute("Appleseed.Core_ResourceScriptRoute", "Appleseed.Core/scripts/{resourceName}",
                  new { controller = "EmbeddedResource", action = "Index", resourcePath = "Scripts" },
                  new string[] { "MvcContrib.PortableAreas" });

                context.MapRoute(
                    "Appleseed.Core_default",
                    "Appleseed.Core/{controller}/{action}/{id}",
                    new { action = "Index", controller = "Home", id = UrlParameter.Optional }
                );

                RegisterAreaEmbeddedResources();
                PortableAreaUtils.RegisterScripts(this, context, bus);
            }
        }
Exemplo n.º 11
0
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
               "Admin",
               "admin",
               new { controller = "Admin", action = "Default", lang = "ru" },
               new { lang = @"ru|en" },
               new[] { "Leo.Areas.Admin.Controllers" }
           );

            context.MapRoute(
               "Admin_Category",
               "{lang}/admin/{controller}/{action}/{id}",
               new { controller = "Admin", action = "Default", id = UrlParameter.Optional },
               new { lang = @"ru|en" },
               new[] { "Leo.Areas.Admin.Controllers" }
           );

            //context.MapRoute(
            //    "Admin_default",
            //    "admin/{controller}/{action}/{id}",
            //    new { controller = "Admin", action = "Default", id = UrlParameter.Optional},
            //    new[] { "Leo.Areas.Admin.Controllers" }
            //);
        }
Exemplo n.º 12
0
        /// <summary>
        /// Create the routes for the area
        /// </summary>
        /// <param name="context"></param>
        /// <remarks>
        /// By using the context to register the routes it means that the area is already applied to them all 
        /// and that the namespaces searched for the controllers are ONLY the ones specified.
        /// </remarks>
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "Umbraco_back_office",
                GlobalSettings.UmbracoMvcArea + "/{action}/{id}",
                new {controller = "BackOffice", action = "Default", id = UrlParameter.Optional},
                //limit the action/id to only allow characters - this is so this route doesn't hog all other 
                // routes like: /umbraco/channels/word.aspx, etc...
                new
                    {
                        action = @"[a-zA-Z]*", 
                        id = @"[a-zA-Z]*"
                    },
                new[] {typeof (BackOfficeController).Namespace});

            //Create the install routes
            context.MapRoute(
                "Umbraco_install_packages",
                "Install/PackageInstaller/{action}/{id}",
                new {controller = "InstallPackage", action = "Index", id = UrlParameter.Optional},
                new[] {typeof (InstallPackageController).Namespace});
            
            //Create the REST/web/script service routes
            context.MapRoute(
                "Umbraco_web_services",
                GlobalSettings.UmbracoMvcArea + "/RestServices/{controller}/{action}/{id}",
                new {controller = "SaveFileController", action = "Index", id = UrlParameter.Optional},
                //look in this namespace for controllers
                new[] {"Umbraco.Web.WebServices"});
        }
Exemplo n.º 13
0
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "Blog_default",
                "{culture}/blog/",
                new { culture = string.Empty, area = "blog", controller = "Blog", action = "Index", id = UrlParameter.Optional },
                new { controller = "blog" },
                new string[] { "Horizon.Web.Areas.Blog.Controllers" });

            context.MapRoute(
                "blog-categories",
                "{culture}/blog/categories)",
                new { culture = string.Empty, area = "blog", controller = "blog", action = "Categories" },
                new { controller = "blog" },
                new string[] { "Horizon.Web.Areas.Blog.Controllers" });

            context.MapRoute(
              "blog-category-view",
              "{culture}/blog/category/{categoryname}",
              new { culture = string.Empty, area = "blog", Controller = "Blog", action = "Category", categoryname = UrlParameter.Optional },
               new { controller = "blog" },
                new string[] { "Horizon.Web.Areas.Blog.Controllers" });

            context.MapRoute(
               "blog-post-view",
               "{culture}/blog/{year}/{month}/{day}/{postname}",
               new { culture = string.Empty, area = "blog", controller = "blog", action = "Post", year = UrlParameter.Optional, month = UrlParameter.Optional, day = UrlParameter.Optional },
               new { controller = "blog" },
               new string[] { "Horizon.Web.Areas.Blog.Controllers" });
        }
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute("InvoiceEmail", "email/invoice/{orderGuid}/{orderId}", new { controller = "InvoiceEmail", action = "Index" });
            context.MapRoute("ContactUsEmail", "email/contact-us", new { controller = "ContactUsEmail", action = "Index" });

            context.MapRoute("Emails_default", "Emails/{controller}/{action}/{id}", new { action = "Index", id = UrlParameter.Optional });
        }
Exemplo n.º 15
0
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "ReceivedBids",
                "Project/{id}/Bid/Received",
                new { controller = "Bid", action = "Received", id = UrlParameter.Optional },
                new { controller = @"Bid", action = "Received" },
                new[] { @"BCWeb.Areas.Project.Controllers" }
                );

            context.MapRoute(
                "InvitationRequests",
                "Project/{id}/Invitation/Requests",
                new { controller = "Invitation", action = "Requests", id = UrlParameter.Optional },
                new { controller = @"Invitation", action = "Requests" },
                new[] { @"BCWeb.Areas.Project.Controllers" }
                );

            context.MapRoute(
                "BidPackageInvite",
                "Project/BidPackage/{bidPackageId}/Invitation/Send",
                new { controller = "Invitation", action = "SendForBidPackage", bidPackageId = UrlParameter.Optional },
                new { controller = @"Invitation", action = "SendForBidPackage" },
                new[] { @"BCWeb.Areas.Project.Controllers" }
            );

            context.MapRoute(
                "Project_default",
                "Project/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional },
                new { controller = @"BidPackage|Invitation|Bid|Document" },
                new[] { @"BCWeb.Areas.Project.Controllers" }
            );
        }
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
               "ListShopsAll",
               "Api/Shops",
               new
               {
                   controller = "Shops",
                   action = "ShopsList",
                   page = UrlParameter.Optional,
                   count = UrlParameter.Optional
               }
               );
            context.MapRoute(
                "ListShopPaged",
                "Api/Shops/ShopsList/{pageNum}/{chunkSize}",
                new
                    {
                        controller = "Shops",
                        action = "ShopsList",
                        pageNum = UrlParameter.Optional,
                        chunkSize = UrlParameter.Optional
                    }
                );

            context.MapRoute(
                "Api_default",
                "Api/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );
        }
Exemplo n.º 17
0
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "Directory",
                "Cheetah/{controller}/{action}/{*location}",
                new { Controller = "Document", action = "Index", Location = UrlParameter.Optional },
                new[] { "Vnsf.WebHost.Areas.Cheetah.Controllers" }
            );

            context.MapRoute(
                "Application",
                "Cheetah/{controller}/{applicationId}/{action}",
                new { Controller = "Application" },
                new[] { "Vnsf.WebHost.Areas.Cheetah.Controllers" }
            );

            context.MapRoute(
                "profile",
                "Cheetah/UserProfile/Education/{action}",
                new { controller = "UserProfile", action = "NewEducation", id = UrlParameter.Optional },
                new[] { "Vnsf.WebHost.Areas.Cheetah.Controllers" }
            );

            context.MapRoute(
                "Cheetah_default",
                "Cheetah/{controller}/{action}/{id}",
                new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                new[] { "Vnsf.WebHost.Areas.Cheetah.Controllers" }
            );
        }
Exemplo n.º 18
0
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "Admin_Home",
                "admin",
                new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );

            context.MapRoute(
                name: "EditPage",
                url: "admin/page/edit/{pageName}",
                defaults: new { controller = "Page", action = "Edit" }
            );

            context.MapRoute(
                name: "DisplayTheme",
                url: "admin/theme/{themeName}",
                defaults: new { controller = "Theme", action = "DisplayTheme" }
            );

            context.MapRoute(
                "Admin_Default",
                "admin/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );
        }
        public override void RegisterArea(AreaRegistrationContext context)
        {
            RegisterAreaEmbeddedResources();
            RegisterEmbeddedViewEngine();

            context.MapRoute(
                "ControlPanel_resources",
                "ControlPanel/{resourceType}/{resourceName}",
                new {controller = "EmbeddedResource", action = "Index"},
                new {resourceType = "^(Fonts|Scripts|Styles|Images)$"},
                new[] { "AzureWebFarm.ControlPanel.Areas.ControlPanel.Controllers" }
            );

            context.MapRoute(
                "ControlPanel_home",
                "",
                new {action = "Index", controller = "Home"},
                new[] { "AzureWebFarm.ControlPanel.Areas.ControlPanel.Controllers" }
            );

            context.MapRoute(
                "ControlPanel_default",
                "ControlPanel/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional },
                new[] { "AzureWebFarm.ControlPanel.Areas.ControlPanel.Controllers" }
            );
        }
Exemplo n.º 20
0
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "Admin",
                "Admin",
                new { Controller = "Home", action = "Index" }
            );

            context.MapRoute(
                "TrocarSenha",
                "TrocarSenha",
                new { Controller = "Usuario", action = "TrocarSenha" }
            );

            context.MapRoute(
                "GetSubAreas",
                "Admin/SubArea/GetSubAreas/{idArea}",
                new { Controller ="SubArea", action = "GetSubAreas", idArea = 0 }
            );

            context.MapRoute(
                "Admin_default",
                "Admin/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );
        }
        public override void RegisterArea(AreaRegistrationContext context, IApplicationBus bus)
        {
            context.MapRoute("PortableAreaMvc3_ResourceRoute", "FileManager/resource/{resourceName}",
               new { controller = "EmbeddedResource", action = "Index" },
               new string[] { "MvcContrib.PortableAreas" });

            context.MapRoute("PortableAreaMvc3_ResourceImageRoute", "FileManager/images/{resourceName}",
              new { controller = "EmbeddedResource", action = "Index", resourcePath = "images" },
              new string[] { "MvcContrib.PortableAreas" });

            context.MapRoute(
                "PortableAreaMvc3_default",
                "FileManager/{controller}/{action}/{id}",
                new { action = "Index", controller = "Home", id = UrlParameter.Optional }
            );

            var assemblyName = Assembly.GetAssembly(this.GetType()).FullName;

            //var generalModuleDefId = ModelServices.RegisterPortableAreaModule(AreaName, assemblyName, "Home");
            //var modDef =  ModelServices.AddModuleToPortal(generalModuleDefId, 0);
            //ModelServices.AddModuleToPage(modDef, 155, "FileManager", false);

            this.RegisterAreaEmbeddedResources();
            PortableAreaUtils.RegisterScripts(this, context, bus);
        }
        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" }
            );
        }
Exemplo n.º 23
0
        public override void RegisterArea(AreaRegistrationContext context) 
        {
            context.MapRoute(
                name: null,
                url: "Admin",
                defaults: new { controller = "Home", action = "Index" }
            );

            context.MapRoute(
                name: null,
                url: "AuthorAphorisms/FindGridView",
                defaults: new { controller = "AuthorAphorisms", action = "FindGridView" }
            );

            context.MapRoute(
                name: null,
                url: "SiteTests/TestMatrix/{testId}/{page}",
                defaults: new { controller = "SiteTests", action = "TestMatrix" }
            );

            context.MapRoute(
                "Admin_default",
                "Admin/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );
        }
Exemplo n.º 24
0
        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" });
        }
Exemplo n.º 25
0
        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" }

            );
        }
        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 });
        }
        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" }
            );
        }
Exemplo n.º 28
0
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "ManageUserScopes",
                "Account/User/{id}/Scopes/Manage",
                new { controller = "Scopes", action = "ManageUser", id = UrlParameter.Optional },
                new { controller = @"Scopes" },
                new[] { "BCWeb.Areas.Account.Controllers" }
            );

            context.MapRoute(
                "ManageCompanyScopes",
                "Account/Company/Scopes/Manage",
                new { controller = "Scopes", action = "ManageCompany" },
                new { controller = @"Scopes" },
                new[] { "BCWeb.Areas.Account.Controllers" }
            );

            context.MapRoute(
                "Account_default",
                "Account/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional },
                new { controller = @"Scopes|Users|Company" },
                new[] { "BCWeb.Areas.Account.Controllers" }
            );
        }
Exemplo n.º 29
0
        public override void RegisterArea(AreaRegistrationContext context)
        {
           context.MapRoute(
                "ServerSentEvent_StatusChangeServerUpdate",
                "StatusChangeServerUpdate",
                new { controller = "User", action = "StatusChangeEvent", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "ServerSent_AdminUserStatusChange",
                "UserStatusChange",
                new { controller = "Admin", action = "UserStatusChange", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "ServerSent_AdminActionOnAll",
                "ActionOnAll",
                new { controller = "Admin", action = "ActionOnAll", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "Html5_default",
                "Html5/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );
        }
Exemplo n.º 30
0
        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute("PSNP_Request",
                "PSNP/Request/",
                new { action = "Index", area = "EarlyWarning", controller = "Request", id = UrlParameter.Optional });

            context.MapRoute(
                 "PSNP_default",
                 "PSNP/{controller}/{action}/{id}",
                 new {action = "Index", id = UrlParameter.Optional }
            );

            context.MapRoute(
                name: "PSNP_Start",
                url:  "PSNP/",
                defaults:  new { controller="Home", action="Index"},
                namespaces:  new []{"Cats.Areas.PSNP.Controllers"}
                );

            context.MapRoute(
                name: "PSNP_Request2",
                url: "PSNP/Request/",
                defaults: new { area = "EarlyWarning", controller = "Request", action = "Index" },
                namespaces: new[] { "Cats.Areas.EarlyWarning.Controllers" }
                );
        }
 public override void RegisterArea(System.Web.Mvc.AreaRegistrationContext context)
 {
     context.MapRoute(
         "Master_default",
         "Master/{controller}/{action}/{id}",
         new { action = "Index", id = UrlParameter.Optional }
         );
 }
Exemplo n.º 32
0
 public override void RegisterArea(System.Web.Mvc.AreaRegistrationContext context)
 {
     //如果更改后没有效果,清空web中bin文件夹的所有dll
     //此路由不能删除
     context.MapRoute("admin_default",
                      "admin/{controller}/{action}/{id}",
                      new { controller = "home", action = "index", area = "admin", id = UrlParameter.Optional },
                      new[] { "OWZX.Web.Admin.Controllers" });
 }
Exemplo n.º 33
0
        public override void RegisterArea(System.Web.Mvc.AreaRegistrationContext context)
        {
            context.MapRoute("Blog",
                             "Blog/{controller}/{action}/{id}",
                             new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                             new string[] { "Blog.Controllers" });

            base.RegisterArea(context);
        }
Exemplo n.º 34
0
 public override void RegisterArea(System.Web.Mvc.AreaRegistrationContext context)
 {
     context.MapRoute(
         "_PageDraft_default",
         "_PageDraft/{controller}/{action}/{id}",
         new { action = "Index", id = UrlParameter.Optional },
         new[] { "Kooboo.CMS.Modules.DiscardDraft", "Kooboo.Web.Mvc", "Kooboo.Web.Mvc.WebResourceLoader" }
         );
     base.RegisterArea(context);
 }
        public override void RegisterArea(System.Web.Mvc.AreaRegistrationContext context)
        {
            context.MapRoute(
                name: AreaName + "_default",
                url: AreaName + "/{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                namespaces: new[] { "Kooboo.Commerce.CMSIntegration.DataSources.Controllers" }
                );

            base.RegisterArea(context);
        }
Exemplo n.º 36
0
        public override void RegisterArea(System.Web.Mvc.AreaRegistrationContext context)
        {
            context.MapRoute(
                name: AreaName + "_default",
                url: AreaName + "/{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                namespaces: new[] { "Kooboo.Commerce.Shipping.ByWeight.Controllers", "Kooboo.Web.Mvc", "Kooboo.Web.Mvc.WebResourceLoader" }
                );

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

            base.RegisterArea(context);
        }
Exemplo n.º 37
0
        public override void RegisterArea(System.Web.Mvc.AreaRegistrationContext context, IApplicationBus bus)
        {
            #region SFSServiceDesk/Views/Shared/
            context.MapRoute("SFSServiceDesk_Views_Shared", "SFSServiceDesk/Views/Shared/{resourceName}",
                             new { controller = "EmbeddedResource", action = "Index", resourcePath = "Views/Shared" },
                             new string[] { "MvcContrib.PortableAreas" });
            #endregion

            #region SFSServiceDesk/Content/Themes/Default/
            context.MapRoute("SFSServiceDesk_ResourceRoute_theme", "SFSServiceDesk/Content/Themes/Default/{resourceName}",
                             new { controller = "EmbeddedResource", action = "Index", resourcePath = "Content/Themes/Default" },
                             new string[] { "MvcContrib.PortableAreas" });
            #endregion
            #region SFSServiceDesk/Content/Themes/Default/css/
            context.MapRoute("SFSServiceDesk_ResourceRoute_theme_css", "SFSServiceDesk/Content/Themes/Default/css/{resourceName}",
                             new { controller = "EmbeddedResource", action = "Index", resourcePath = "Content/Themes/Default/css" },
                             new string[] { "MvcContrib.PortableAreas" });
            #endregion



            context.MapRoute("SFSServiceDesk_ResourceRoute_js", "SFSServiceDesk/Content/js/{resourceName}",
                             new { controller = "EmbeddedResource", action = "Index", resourcePath = "Content/js" },
                             new string[] { "MvcContrib.PortableAreas" });



            #region SFSServiceDesk/Content/Themes/Default/img/
            context.MapRoute("SFSServiceDesk_ResourceRoute_theme_img", "SFSServiceDesk/Content/Themes/Default/img/{resourceName}",
                             new { controller = "EmbeddedResource", action = "Index", resourcePath = "Content/Themes/Default/img" },
                             new string[] { "MvcContrib.PortableAreas" });
            #endregion
            #region SFSServiceDesk/Content/img/
            context.MapRoute("SFSServiceDesk_ResourceRoute_img", "SFSServiceDesk/Content/img/{resourceName}",
                             new { controller = "EmbeddedResource", action = "Index", resourcePath = "Content/img" },
                             new string[] { "MvcContrib.PortableAreas" });
            #endregion

            context.MapRoute("SFSServiceDesk_ResourceImageRoute", "SFSServiceDesk/images/{resourceName}",
                             new { controller = "EmbeddedResource", action = "Index", resourcePath = "images" },
                             new string[] { "MvcContrib.PortableAreas" });

            context.MapRoute("SFSServiceDesk_Default",
                             "SFSServiceDesk/{controller}/{action}",
                             new { controller = "Home",
                                   action     = "index" },
                             new string[] { "SFS.ServiceDesk.Web.Mvc.Controllers" });

            context.MapRoute(
                "SFSServiceDesk_Id",                         // Route name
                "SFSServiceDesk/{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home",
                      action     = "Index",
                      id         = UrlParameter.Optional },
                new[] { "SFS.ServiceDesk.Web.Mvc.Controllers" });

            //context.MapRoute(
            // "SFSServiceDesk_usemode_Id", // Route name
            // "SFSServiceDesk/{controller}/usemode/{usemode}/{action}/{id}", // URL with parameters
            // new
            // {
            //     controller = "Home",
            //     action = "Index",
            //     id = UrlParameter.Optional
            // },
            //     new[] { "SFS.ServiceDesk.Web.Mvc.Controllers"
            //      });



            //ControllerBuilder.Current.DefaultNamespaces.Add("SFS.ServiceDesk.Web.Mvc.Controllers");

            this.RegisterAreaEmbeddedResources();
            if (Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["AutoInjectPermissionsOnStartup"]))
            {
                SecuritySettings.PermissionsInitialization();
            }

            OnAreaRegistration(this, new EventArgs());
        }