public override void RegisterArea(AreaRegistrationContext context) { context?.MapRoute( "RelationshipManagement_default", "{operationNumber}/RelationshipManagement/{controller}/{action}/{id}", new { action = "Index", id = UrlParameter.Optional }); }
/// <summary>Register this area.</summary> /// <param name="context">The area registration context.</param> public override void RegisterArea(AreaRegistrationContext context) { context?.MapRoute( "<%= areaName %>_default", "<%= areaName %>/{controller}/{action}/{id}", new { action = "Index", id = UrlParameter.Optional }); }
/// <summary> /// Registers ares. /// </summary> /// <param name="context">Area registration context.</param> public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute( "KnockoutJS_default", "KnockoutJS/{controller}/{action}/{id}", new { action = "Index", id = UrlParameter.Optional } ); }
public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute( string.Format("{0}_default", AdminOnlyControllerAreaRegistration.AdminOnlyControllerAttributeAreaName), string.Format("{0}/{{action}}/{{id}}", AdminOnlyControllerAreaRegistration.AdminOnlyControllerAttributeAreaName), new { controller = AdminOnlyControllerAreaRegistration.AdminOnlyControllerAttributeAreaName, action = "Index", id = UrlParameter.Optional } ); }
public void GetAreaNameFromAreaRouteCollectionRoute() { // Arrange RouteCollection routes = new RouteCollection(); AreaRegistrationContext context = new AreaRegistrationContext("area_name", routes); Route route = context.MapRoute(null, "the_url"); // Act string areaName = AreaHelpers.GetAreaName(route); // Assert Assert.Equal("area_name", areaName); }
public void GetAreaNameFromRouteDataFallsBackToRoute() { // Arrange RouteCollection routes = new RouteCollection(); AreaRegistrationContext context = new AreaRegistrationContext("area_name", routes); Route route = context.MapRoute(null, "the_url"); RouteData routeData = new RouteData(route, new MvcRouteHandler()); // Act string areaName = AreaHelpers.GetAreaName(routeData); // Assert Assert.Equal("area_name", areaName); }
public void MapRouteWithExplicitNamespaces() { // Arrange string[] implicitNamespaces = new string[] { "implicit_1", "implicit_2" }; string[] explicitNamespaces = new string[] { "explicit_1", "explicit_2" }; RouteCollection routes = new RouteCollection(); AreaRegistrationContext context = new AreaRegistrationContext("the_area", routes); ReplaceCollectionContents(context.Namespaces, implicitNamespaces); // Act Route route = context.MapRoute("the_name", "the_url", explicitNamespaces); // Assert Assert.Equal(route, routes["the_name"]); Assert.Equal("the_area", route.DataTokens["area"]); Assert.Equal(false, route.DataTokens["UseNamespaceFallback"]); Assert.Equal(explicitNamespaces, (string[])route.DataTokens["namespaces"]); }
public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute( "Account_Customer", "Customer/{action}/{id}", new { controller = "Customer", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Account_Contact", "Contact/{action}/{id}", new { controller = "Contact", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Account_ContractLease", "ContractLease/{action}/{id}", new { controller = "ContractLease", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Account_InfoPartyA", "InfoPartyA/{action}/{id}", new { controller = "InfoPartyA", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Account_ContractSell", "ContractSell/{action}/{id}", new { controller = "ContractSell", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Account_Contract", "Contract/{action}/{id}", new { controller = "Contract", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Account_ProcessPayment", "ProcessPayment/{action}/{id}", new { controller = "ProcessPayment", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Account_Transaction", "Transaction/{action}/{id}", new { controller = "Transaction", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Account_Receipt", "Receipt/{action}/{id}", new { controller = "Receipt", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Account_Payment", "Payment/{action}/{id}", new { controller = "Payment", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Account_Report", "AccountReport/{action}/{id}", new { controller = "AccountReport", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Account_CustomerDiscount", "CustomerDiscount/{action}/{id}", new { controller = "CustomerDiscount", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Account_CustomerCommitment", "CustomerCommitment/{action}/{id}", new { controller = "CustomerCommitment", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Account_TransactionLiabilities", "TransactionLiabilities/{action}/{id}", new { controller = "TransactionLiabilities", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Account_MemberCard", "MemberCard/{action}/{id}", new { controller = "MemberCard", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Account_MemberCardDetail", "MemberCardDetail/{action}/{id}", new { controller = "MemberCardDetail", action = "Index", id = UrlParameter.Optional } ); //<append_content_route_here> RegisterAutoMapperMap(); }
public override void RegisterArea(AreaRegistrationContext context){ routes.MapRoute("Transacciones_Home", "Transacciones", new { Controller = "Transacciones", Action = "Index" }); context.MapRoute( “Transacciones_default”, “Transacciones/{controller}/{action}/{id}”,
/// <summary> /// Registers ares. /// </summary> /// <param name="context">Area registration context.</param> public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute(name: "AuthorDetails", url: "MVC/Author/Details/{id}/{FirstName}/{LastName}/{BooksCount}", defaults: new { area = "MVC", controller = "Author", action = "Details", id = UrlParameter.Optional, FirstName = UrlParameter.Optional, LastName = UrlParameter.Optional, BooksCount = UrlParameter.Optional }); context.MapRoute("MVC_default", "MVC/{controller}/{action}/{id}", new { area = "MVC", controller = "Book", action = "Index", id = UrlParameter.Optional }); }
/// <summary> /// Register routes /// </summary> /// <param name="context">The context.</param> private void RegisterRoutes(AreaRegistrationContext context) { context.MapRoute("TU_Tenant", "{tenantAlias}/TU/{controller}/{action}/{id}", new { action = "Index", id = UrlParameter.Optional }); }
public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute( "Post_12", "a/{postId}/", new { Area = "Users", controller = "Post", action = "GetResults", postId = UrlParameter.Optional }, namespaces: new string[] { "smartData.Areas.Users.Controllers" } ); context.MapRoute( "Users_elmah", "Users/elmah/{type}", new { action = "Index", controller = "Elmah", type = UrlParameter.Optional }); context.MapRoute( "Users_elmahdetail", "Users/elmah/detail/{type}", new { action = "Index", controller = "Elmah", type = UrlParameter.Optional } ); context.MapRoute( "Users_elmahabout", "Users/elmah/about/{type}", new { action = "Index", controller = "Elmah", type = UrlParameter.Optional } ); context.MapRoute( "Users_elmahdetailabout", "Users/elmah/detail/about/{type}", new { action = "Index", controller = "Elmah", type = UrlParameter.Optional } ); context.MapRoute( "Login", "login", new { Area = "Users", controller = "Account", action = "Login", id = UrlParameter.Optional }, namespaces: new string[] { "smartData.Areas.Users.Controllers" } ); context.MapRoute( "realtor/login", "{realtor}/login", new { Area = "Users", controller = "Account", action = "Login", id = UrlParameter.Optional }, namespaces: new string[] { "smartData.Areas.Users.Controllers" } ); context.MapRoute( "realtor/Register", "{realtor}/Register", new { Area = "Users", controller = "Account", action = "Register", id = UrlParameter.Optional }, namespaces: new string[] { "smartData.Areas.Users.Controllers" } ); // context.MapRoute( // "Users_default1", // "Users/{controller}/{action}/{id}", // new { Area = "Users", controller = "Account", action = "Login", id = UrlParameter.Optional }, // namespaces: new string[] { "smartData.Areas.Users.Controllers" } //); // context.MapRoute( //"ResetPassword", //"Users/{controller}/{action}/{id}", //new { Area = "Users", controller = "Account", action = "ResetPassword", id = UrlParameter.Optional }, //namespaces: new string[] { "smartData.Areas.Users.Controllers" } //); context.MapRoute( "User", "user", new { area = "Users", controller = "Home", action = "Index", id = UrlParameter.Optional }, namespaces: new string[] { "smartData.Areas.Users.Controllers" } ); context.MapRoute( "UserDashboardRoute", "user/dashboard/{id}", new { area = "Users", controller = "Home", action = "Index", id = UrlParameter.Optional }, namespaces: new string[] { "smartData.Areas.Users.Controllers" } ); context.MapRoute( "ManageSocialMedia", "SocialMedia/{id}", new { Area = "Users", controller = "Home", action = "ManageSocialMedia", id = UrlParameter.Optional }, namespaces: new string[] { "smartData.Areas.Users.Controllers" } ); context.MapRoute( "Facebook", "{controller}/{action}/{id}", new { Area = "Users", controller = "Home", action = "Index", id = UrlParameter.Optional }, namespaces: new string[] { "smartData.Areas.Users.Controllers" } ); context.MapRoute( "LinkedinCallBack", "{controller}/{action}/{id}", new { Area = "Users", controller = "Home", action = "OAuth2", id = UrlParameter.Optional }, namespaces: new string[] { "smartData.Areas.Users.Controllers" } ); context.MapRoute( "TwitterCallBack", "{controller}/{action}/{id}", new { Area = "Users", controller = "Home", action = "AuthorizeCallback", id = UrlParameter.Optional }, namespaces: new string[] { "smartData.Areas.Users.Controllers" } ); context.MapRoute( "GooglePlusCallBack", "{controller}/{action}/{id}", new { Area = "Users", controller = "Home", action = "GoogleCallBack", id = UrlParameter.Optional }, namespaces: new string[] { "smartData.Areas.Users.Controllers" } ); context.MapRoute( "Schedule", "{controller}/schedule/{id}", new { Area = "Users", controller = "Home", action = "SchedulePost", id = UrlParameter.Optional }, namespaces: new string[] { "smartData.Areas.Users.Controllers" } ); }
public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute("WFSTREAMArea_default", "WFSTREAMArea/{controller}/{action}/{id}", new { action = "Index", id = UrlParameter.Optional }); }
public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute( "admin_Quan Ly Luong", "admin/quan-ly-luong", new { Controller = "QuanLyLuong", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "admin_sua_luong", "admin/quan-ly-luong/sua-bang-luong", new { Controller = "QuanLyLuong", action = "SuaBangLuong", id = UrlParameter.Optional } ); context.MapRoute( "admin_ds_luong", "admin/quan-ly-luong/danh-sach-nhan-luong", new { Controller = "QuanLyLuong", action = "DanhSachNhanLuong", id = UrlParameter.Optional } ); context.MapRoute( "admin_tang_luong", "admin/quan-ly-luong/qua-trinh-tang-luong", new { Controller = "QuanLyLuong", action = "QuaTrinhTangLuong", id = UrlParameter.Optional } ); //================quan ly phong ban=========================================== context.MapRoute( "admin_Quan Ly Phong Ban", "admin/quan-ly-phong-ban", new { Controller = "QuanLyPhongBan", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "admin_sua_phong_ban", "admin/quan-ly-phong-ban/sua-thong-tin-phong-ban", new { Controller = "QuanLyPhongBan", action = "SuaPhongBan", id = UrlParameter.Optional } ); context.MapRoute( "admin_them_phong_ban", "admin/quan-ly-phong-ban/them-phong-ban", new { Controller = "QuanLyPhongBan", action = "ThemPhongBan", id = UrlParameter.Optional } ); context.MapRoute( "admin_nhan_vien_phong_ban", "admin/quan-ly-phong-ban/nhan-vien-phong-ban", new { Controller = "QuanLyPhongBan", action = "DanhSachNhanVien", id = UrlParameter.Optional } ); context.MapRoute( "admin_chuyen-nhan-vien", "admin/quan-ly-phong-ban/chuyen-nhan-vien", new { Controller = "QuanLyPhongBan", action = "ChuyenNhanVien", id = UrlParameter.Optional } ); context.MapRoute( "admin_phu-cap-chuc-vu", "admin/quan-ly-phong-ban/phu-cap-chuc-vu", new { Controller = "QuanLyPhongBan", action = "CapNhatPhuCap", id = UrlParameter.Optional } ); //========================quan ly tai khoan================================= context.MapRoute( "admin_Quan-Ly-Tai-Khoan", "admin/quan-ly-nhan-vien", new { Controller = "QuanLyUser", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "admin_sua-thong-tin", "admin/quan-ly-nhan-vien/sua-thong-tin", new { Controller = "QuanLyUser", action = "UpdateUser", id = UrlParameter.Optional } ); context.MapRoute( "admin_them-tai-khoan", "admin/quan-ly-nhan-vien/them-nhan-vien", new { Controller = "QuanLyUser", action = "ThemUser", id = UrlParameter.Optional } ); context.MapRoute( "admin_qua-trinh-cong-tac", "admin/quan-ly-nhan-vien/qua-trinh-cong-tac", new { Controller = "QuanLyUser", action = "QuaTrinhCongTac", id = UrlParameter.Optional } ); context.MapRoute( "admin_qua-trinh-hoc-tap", "admin/quan-ly-nhan-vien/qua-trinh-hoc-tap", new { Controller = "QuanLyUser", action = "QuaTrinhHoc", id = UrlParameter.Optional } ); //==========================default=================================== context.MapRoute( "admin_default", "admin/{controller}/{action}/{id}", new { controller = "QuanLyPhongBan", action = "Index", id = UrlParameter.Optional, Areas = "admin" } ); }
private static void AddRoute(AreaRegistrationContext context, string controller, string path) { context.MapRoute(path, path + "/{action}/{id}", new { controller, action = "Index", id = "" }); }
public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute("HelpPage_Default", "Help/{action}/{apiId}", new { controller = "Help", action = "Index", apiId = UrlParameter.Optional }); HelpPageConfig.Register(GlobalConfiguration.Configuration); }
public override void RegisterArea(AreaRegistrationContext context) { //对于IIS6.0默认配置不支持无扩展名的url string extensionForOldIIS = ".html"; int iisVersion = 0; if (!int.TryParse(ConfigurationManager.AppSettings["IISVersion"], out iisVersion)) { iisVersion = 7; } if (iisVersion >= 7) { extensionForOldIIS = string.Empty; } #region Channel //资讯频道-资讯首页 context.MapRoute( "Channel_CMS_Home", // Route name "CMS" + extensionForOldIIS, // URL with parameters new { controller = "ChannelCms", action = "Home", CurrentNavigationId = "10101502" } // Parameter defaults ); //资讯频道-栏目列表 context.MapRoute( "Channel_CMS_FolderDetail", // Route name "CMS/f-{contentFolderId}" + extensionForOldIIS, // URL with parameters new { controller = "ChannelCms", action = "FolderDetail", CurrentNavigationId = "10101501" } // Parameter defaults ); //资讯频道-资讯详情页 context.MapRoute( "Channel_CMS_ContentItemDetail", // Route name "CMS/c-{contentItemId}" + extensionForOldIIS, // URL with parameters new { controller = "ChannelCms", action = "ContentItemDetail", CurrentNavigationId = "10101501" } // Parameter defaults ); //资讯频道-标签详情页 context.MapRoute( "Channel_CMS_TagDetail", // Route name "CMS/t-{tagName}" + extensionForOldIIS, // URL with parameters new { controller = "ChannelCms", action = "TagDetail", CurrentNavigationId = "10101501" } // Parameter defaults ); //资讯频道-我的资讯 context.MapRoute( "Channel_CMS_User", // Route name "CMS/u/{SpaceKey}" + extensionForOldIIS, // URL with parameters new { controller = "ChannelCms", action = "CmsUser", CurrentNavigationId = "10101506" } // Parameter defaults ); //资讯频道-我的资讯 context.MapRoute( "Channel_CMS_My", // Route name "CMS/My" + extensionForOldIIS, // URL with parameters new { controller = "ChannelCms", action = "CmsUser", CurrentNavigationId = "10101506" } // Parameter defaults ); //资讯频道-投稿 context.MapRoute( "Channel_CMS_Contribute", // Route name "CMS/Contribute" + extensionForOldIIS, // URL with parameters new { controller = "ChannelCms", action = "Contribute", CurrentNavigationId = "10101501" } // Parameter defaults ); context.MapRoute( "Channel_CMS_Common", // Route name "CMS/{action}" + extensionForOldIIS, // URL with parameters new { controller = "ChannelCms", action = "Home" } // Parameter defaults ); #endregion #region 动态列表控件路由 context.MapRoute( string.Format("ActivityDetail_{0}_CreateCmsComment", TenantTypeIds.Instance().Comment()), // Route name "CmsActivity/CreateComment/{ActivityId}" + extensionForOldIIS, // URL with parameters new { controller = "ChannelCms", action = "_CreateCmsComment" } // Parameter defaults ); #endregion #region ControlPanel context.MapRoute( "ControlPanel_CMS_Home", // Route name "ControlPanel/Content/CMS/ManageContentItems" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelCms", action = "ManageContentItems", CurrentNavigationId = "20101501" } // Parameter defaults ); context.MapRoute( "ControlPanel_CMS_Common", // Route name "ControlPanel/Content/CMS/{action}" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelCms", CurrentNavigationId = "20101501" } // Parameter defaults ); #endregion #region Handler context.Routes.MapHttpHandler <ContentAttachmentAuthorizeHandler>("ContentAttachmentAuthorize", "Handlers/ContentAttachmentAuthorize.ashx"); context.Routes.MapHttpHandler <ContentAttachmentDownloadHandler>("ContentAttachment", "Handlers/ContentAttachment.ashx"); #endregion }
public override void RegisterArea(AreaRegistrationContext context) { //对于IIS6.0默认配置不支持无扩展名的url string extensionForOldIIS = ".aspx"; int iisVersion = 0; if (!int.TryParse(ConfigurationManager.AppSettings["IISVersion"], out iisVersion)) { iisVersion = 7; } if (iisVersion >= 7) { extensionForOldIIS = string.Empty; } #region Channel context.MapRoute( "Channel_Bar_Home", // Route name "Bar" + extensionForOldIIS, // URL with parameters new { controller = "Bar", action = "Home" } // Parameter defaults ); context.MapRoute( "Channel_Bar_SectionDetail", // Route name "Bar/s-{sectionId}-{pageIndex}" + extensionForOldIIS, // URL with parameters new { controller = "Bar", action = "SectionDetail", pageIndex = 1 }, // Parameter defaults new { sectionId = @"(\d+)|(\{\d+\})", pageIndex = @"(\d+)|(\{\d+\})" } ); context.MapRoute( "Channel_Bar_ThreadDetail", // Route name "Bar/t-{threadId}" + extensionForOldIIS, // URL with parameters new { controller = "Bar", action = "ThreadDetail" }, // Parameter defaults new { threadId = @"(\d+)|(\{\d+\})" } // Parameter defaults ); context.MapRoute( "Channel_Bar_UserBar", // Route name "Bar/u-{spaceKey}" + extensionForOldIIS, // URL with parameters new { controller = "Bar", action = "UserThreads" } ); context.MapRoute( "Channel_Bar_Tag", // Route name "Bar/t-{tagName}" + extensionForOldIIS, // URL with parameters new { controller = "Bar", action = "ListsByTag" } // Parameter defaults ); context.MapRoute( "Channel_Bar_Common", // Route name "Bar/{action}" + extensionForOldIIS, // URL with parameters new { controller = "Bar", action = "Home" } // Parameter defaults ); #endregion #region GroupSpace context.MapRoute( "Group_Bar_SectionDetail", // Route name "g/{spaceKey}/bar/home" + extensionForOldIIS, // URL with parameters new { controller = "GroupSpaceBar", action = "SectionDetail", CurrentNavigationId = "13101201" } // Parameter defaults ); context.MapRoute( "Group_Bar_ThreadDetail", // Route name "g/{spaceKey}/bar/t-{threadId}" + extensionForOldIIS, // URL with parameters new { controller = "GroupSpaceBar", action = "Detail" }, // Parameter defaults new { threadId = @"(\d+)|(\{\d+\})" } // Parameter defaults ); context.MapRoute( "Group_Bar_UserBar", // Route name "g/{spaceKey}/bar/MyPosts" + extensionForOldIIS, // URL with parameters new { controller = "GroupSpaceBar", action = "UserThreads", CurrentNavigationId = "13101201" } ); context.MapRoute( "Group_Bar_Edit", // Route name "g/{spaceKey}/bar/Edit" + extensionForOldIIS, // URL with parameters new { controller = "GroupSpaceBar", action = "Edit" } ); context.MapRoute( "Group_Bar_ManageThreads", // Route name "g/{spaceKey}/bar/ManageThreads" + extensionForOldIIS, // URL with parameters new { controller = "GroupSpaceBar", action = "ManageThreads", CurrentNavigationId = "13101205" } // Parameter defaults ); context.MapRoute( "Group_Bar_Tag", // Route name "g/{spaceKey}/bar/t-{tagName}" + extensionForOldIIS, // URL with parameters new { controller = "GroupSpaceBar", action = "ListByTag" } // Parameter defaults ); context.MapRoute( "Group_Bar_Common", // Route name "g/{spaceKey}/bar/{action}" + extensionForOldIIS, // URL with parameters new { controller = "GroupSpaceBar", action = "SectionDetail" } // Parameter defaults ); #endregion #region TopicSpace context.MapRoute( "Topic_Bar_SectionDetail", // Route name "t/{spaceKey}/bar/home" + extensionForOldIIS, // URL with parameters new { controller = "TopicSpaceBar", action = "SectionDetail", CurrentNavigationId = "13101201" } // Parameter defaults ); context.MapRoute( "Topic_Bar_ThreadDetail", // Route name "t/{spaceKey}/bar/t-{threadId}" + extensionForOldIIS, // URL with parameters new { controller = "TopicSpaceBar", action = "Detail" }, // Parameter defaults new { threadId = @"(\d+)|(\{\d+\})" } // Parameter defaults ); context.MapRoute( "Topic_Bar_UserBar", // Route name "t/{spaceKey}/bar/MyPosts" + extensionForOldIIS, // URL with parameters new { controller = "TopicSpaceBar", action = "UserThreads", CurrentNavigationId = "13101201" } ); context.MapRoute( "Topic_Bar_Edit", // Route name "t/{spaceKey}/bar/Edit" + extensionForOldIIS, // URL with parameters new { controller = "TopicSpaceBar", action = "Edit" } ); context.MapRoute( "Topic_Bar_ManageThreads", // Route name "t/{spaceKey}/bar/ManageThreads" + extensionForOldIIS, // URL with parameters new { controller = "TopicSpaceBar", action = "ManageThreads", CurrentNavigationId = "13101205" } // Parameter defaults ); context.MapRoute( "Topic_Bar_Tag", // Route name "t/{spaceKey}/bar/t-{tagName}" + extensionForOldIIS, // URL with parameters new { controller = "TopicSpaceBar", action = "ListByTag" } // Parameter defaults ); context.MapRoute( "Topic_Bar_Common", // Route name "t/{spaceKey}/bar/{action}" + extensionForOldIIS, // URL with parameters new { controller = "TopicSpaceBar", action = "SectionDetail" } // Parameter defaults ); #endregion #region ControlPanel context.MapRoute( "ControlPanel_Bar_Home", // Route name "ControlPanelBar" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelBar", action = "ManageThreads", CurrentNavigationId = "20101201" } // Parameter defaults ); context.MapRoute( "ControlPanel_Bar_Common", // Route name "ControlPanelBar/{action}" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelBar", CurrentNavigationId = "20000010" } // Parameter defaults ); //群组贴吧管理帖子 context.MapRoute( "ControlPanel_GroupBar_ManageThreads", // Route name "ControlPanelGroupBar/ManageThreads" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelBar", action = "ManageThreads", CurrentNavigationId = "20101101", tenantTypeId = TenantTypeIds.Instance().Group() } // Parameter defaults ); //群组贴吧管理回帖 context.MapRoute( "ControlPanel_GroupBar_ManagePosts", // Route name "ControlPanelGroupBar/ManagePosts" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelBar", action = "ManagePosts", CurrentNavigationId = "20101101", tenantTypeId = TenantTypeIds.Instance().Group() } // Parameter defaults ); #endregion context.MapRoute( string.Format("ActivityDetail_{0}_CreateBarThread", TenantTypeIds.Instance().BarThread()), // Route name "BarActivity/CreateThread/{ActivityId}" + extensionForOldIIS, // URL with parameters new { controller = "BarActivity", action = "_CreateBarThread" } // Parameter defaults ); context.MapRoute( string.Format("ActivityDetail_{0}_CreateBarPost", TenantTypeIds.Instance().BarPost()), // Route name "BarActivity/CreatePost/{ActivityId}" + extensionForOldIIS, // URL with parameters new { controller = "BarActivity", action = "_CreateBarPost" } // Parameter defaults ); context.MapRoute( string.Format("ActivityDetail_{0}_CreateBarRating", TenantTypeIds.Instance().BarRating()), // Route name "BarActivity/CreateRating/{ActivityId}" + extensionForOldIIS, // URL with parameters new { controller = "BarActivity", action = "_CreateBarRating" } // Parameter defaults ); #region Handler context.Routes.MapHttpHandler <BarUrlHandler>("BarUrl", "Service/Bar/BarUrl.ashx"); #endregion }
public override void RegisterArea(AreaRegistrationContext context) { //o artículo: englishforcoaches.com /{ categoría}/{ titulo} //o categoría: englishforcoaches.com /{ categoría} //o etiqueta: englishforcoaches.com / tag /{ etiqueta} //o etiqueta: englishforcoaches.com / search /{ texto} context.MapRoute( "Publico_about", "about", new { controller = "Articulos", action = "About" }, new[] { "EnglishForCoachesWeb.Areas.Publico.Controllers" } ); context.MapRoute( "Publico_tag", "tag/{id}", new { controller = "Articulos", action = "Tag" }, new[] { "EnglishForCoachesWeb.Areas.Publico.Controllers" } ); context.MapRoute( "Publico_buscar", "search/{id}", new { controller = "Articulos", action = "Buscar" }, new[] { "EnglishForCoachesWeb.Areas.Publico.Controllers" } ); context.MapRoute( "Publico_categoria", "{categoriaUrl}", new { controller = "Articulos", action = "Categoria" }, new[] { "EnglishForCoachesWeb.Areas.Publico.Controllers" } ); context.MapRoute( "Publico_articulo", "{categoriaUrl}/{articuloUrl}", new { controller = "Articulos", action = "Articulo" }, new[] { "EnglishForCoachesWeb.Areas.Publico.Controllers" } ); context.MapRoute( "Publico_default", "Publico/{controller}/{action}/{id}", new { action = "Index", id = UrlParameter.Optional }, new[] { "EnglishForCoachesWeb.Areas.Publico.Controllers" } ); context.MapRoute( "Publico_index", "", new { controller = "Articulos", action = "Index" }, new[] { "EnglishForCoachesWeb.Areas.Publico.Controllers" } ); }
public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute("CheckIn_default", "CheckIn/{action}/{id}", new { controller = "CheckIn", action = "Index", id = UrlParameter.Optional } ); }
private void AddRoute(AreaRegistrationContext context, string controller) { context.MapRoute(controller, controller + "/{action}/{id}", new { controller, action = "Index", id = "" }); }
public override void RegisterAreaOrder(AreaRegistrationContext context) { context.MapRoute("Admin_default", "Admin/{controller}/{action}/{id}", new { controller = "home", action = "Index", id = UrlParameter.Optional }); }
private static void AddRoute(AreaRegistrationContext context, string name, string controller, string path, string action) { context.MapRoute(name, path, new { controller, action = action, id = "" }); }
public override void RegisterArea(AreaRegistrationContext context) { //对于IIS6.0默认配置不支持无扩展名的url string extensionForOldIIS = ".html"; int iisVersion = 0; if (!int.TryParse(ConfigurationManager.AppSettings["IISVersion"], out iisVersion)) { iisVersion = 7; } if (iisVersion >= 7) { extensionForOldIIS = string.Empty; } #region Channel //问答频道-问答首页 context.MapRoute( "Channel_Ask_Home", // Route name "Ask" + extensionForOldIIS, // URL with parameters new { controller = "ChannelAsk", action = "Home", CurrentNavigationId = "10101302" } // Parameter defaults ); //问答频道-问题 context.MapRoute( "Channel_Ask_Questions", // Route name "Ask/Questions" + extensionForOldIIS, // URL with parameters new { controller = "ChannelAsk", action = "Questions", CurrentNavigationId = "10101303" } // Parameter defaults ); //问答频道-问题详情页 context.MapRoute( "Channel_Ask_QuestionDetail", // Route name "Ask/q-{questionId}" + extensionForOldIIS, // URL with parameters new { controller = "ChannelAsk", action = "QuestionDetail", CurrentNavigationId = "10101303" } // Parameter defaults ); //问答频道-关注问题的用户 context.MapRoute( "Channel_Ask_QuestionFollowers", // Route name "Ask/qf-{questionId}" + extensionForOldIIS, // URL with parameters new { controller = "ChannelAsk", action = "QuestionFollowers", CurrentNavigationId = "10101303" } // Parameter defaults ); //问答频道-标签 context.MapRoute( "Channel_Ask_Tags", // Route name "Ask/Tags" + extensionForOldIIS, // URL with parameters new { controller = "ChannelAsk", action = "Tags", CurrentNavigationId = "10101304" } // Parameter defaults ); //问答频道-标签详情页 context.MapRoute( "Channel_Ask_TagDetail", // Route name "Ask/t-{tagName}" + extensionForOldIIS, // URL with parameters new { controller = "ChannelAsk", action = "TagDetail", CurrentNavigationId = "10101304" } // Parameter defaults ); //问答频道-关注问题的用户 context.MapRoute( "Channel_Ask_TagFollowers", // Route name "Ask/tf-{tagId}" + extensionForOldIIS, // URL with parameters new { controller = "ChannelAsk", action = "TagFollowers", CurrentNavigationId = "10101304" } // Parameter defaults ); //问答频道-用户 context.MapRoute( "Channel_Ask_Rank", // Route name "Ask/Rank" + extensionForOldIIS, // URL with parameters new { controller = "ChannelAsk", action = "Rank", CurrentNavigationId = "10101305" } // Parameter defaults ); //问答频道-我的问答 context.MapRoute( "Channel_Ask_User", // Route name "Ask/u/{SpaceKey}" + extensionForOldIIS, // URL with parameters new { controller = "ChannelAsk", action = "AskUser", CurrentNavigationId = "10101306" } // Parameter defaults ); //问答频道-我的问答 context.MapRoute( "Channel_Ask_My", // Route name "Ask/My" + extensionForOldIIS, // URL with parameters new { controller = "ChannelAsk", action = "AskUser", CurrentNavigationId = "10101306" } // Parameter defaults ); //问答频道-提问 context.MapRoute( "Channel_Ask_EditQuestion", // Route name "Ask/EditQuestion" + extensionForOldIIS, // URL with parameters new { controller = "ChannelAsk", action = "EditQuestion", CurrentNavigationId = "10101303" } // Parameter defaults ); context.MapRoute( "Channel_Ask_Common", // Route name "Ask/{action}" + extensionForOldIIS, // URL with parameters new { controller = "ChannelAsk", action = "Home" } // Parameter defaults ); #endregion #region ControlPanel context.MapRoute( "ControlPanel_Ask_Home", // Route name "ControlPanel/Content/Ask/ManageQuestions" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelAsk", action = "ManageQuestions", CurrentNavigationId = "20101301" } // Parameter defaults ); context.MapRoute( "ControlPanel_Ask_Common", // Route name "ControlPanel/Content/Ask/{action}" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelAsk", CurrentNavigationId = "20101301" } // Parameter defaults ); #endregion #region 动态列表控件路由 context.MapRoute( string.Format("ActivityDetail_{0}_CreateAskQuestion", TenantTypeIds.Instance().AskQuestion()), // Route name "AskActivity/CreateAskQuestion/{ActivityId}" + extensionForOldIIS, // URL with parameters new { controller = "AskActivity", action = "_CreateAskQuestion" } // Parameter defaults ); context.MapRoute( string.Format("ActivityDetail_{0}_CreateAskAnswer", TenantTypeIds.Instance().AskAnswer()), // Route name "AskActivity/CreateAskAnswer/{ActivityId}" + extensionForOldIIS, // URL with parameters new { controller = "AskActivity", action = "_CreateAskAnswer" } // Parameter defaults ); context.MapRoute( string.Format("ActivityDetail_{0}_CommentAskQuestion", TenantTypeIds.Instance().Comment()), // Route name "AskActivity/CommentAskQuestion/{ActivityId}" + extensionForOldIIS, // URL with parameters new { controller = "AskActivity", action = "_CommentAskQuestion" } // Parameter defaults ); context.MapRoute( string.Format("ActivityDetail_{0}_CommentAskAnswer", TenantTypeIds.Instance().Comment()), // Route name "AskActivity/CommentAskAnswer/{ActivityId}" + extensionForOldIIS, // URL with parameters new { controller = "AskActivity", action = "_CommentAskAnswer" } // Parameter defaults ); context.MapRoute( string.Format("ActivityDetail_{0}_SupportAskAnswer", TenantTypeIds.Instance().AskAnswer()), // Route name "AskActivity/SupportAskAnswer/{ActivityId}" + extensionForOldIIS, // URL with parameters new { controller = "AskActivity", action = "_SupportAskAnswer" } // Parameter defaults ); #endregion }
public override void RegisterArea(AreaRegistrationContext context) { #region == Survey == context.MapRoute( "Survey_default", "survey/{file}.html", new { controller = "Survey", action = "Show" } ); context.MapRoute( "en_survey_default", "en/survey/{file}.html", new { controller = "Survey", action = "Show" } ); #endregion #region == Channel == context.MapRoute( "Channel_default", "Channel/{cat}.html", new { controller = "Channel", action = "Show" } ); context.MapRoute( "EnChannel_default", "en/channel/{cat}.html", new { controller = "Channel", action = "Show" } ); #endregion #region == ArticleShow == //context.MapRoute( // "ArticleShow", // "{year}-{month}-{day}/{id}.html", // new { controller = "Article", action = "Show", id = @"\d+", year = @"\d+", month = @"\d+", day = @"\d+", data = @"\d{0,4}-\d{0,2}-\d{0,2}" } //); //context.MapRoute( // "EnArticleShow", // "en/{year}-{month}-{day}/{id}.html", // new { controller = "Article", action = "Show", id = @"\d+", year = @"\d+", month = @"\d+", day = @"\d+", data = @"\d{0,4}-\d{0,2}-\d{0,2}" } //); context.MapRoute( "ArticleShow", "n/{guid}.html", new { controller = "Article", action = "Show" } ); context.MapRoute( "EnArticleShow", "en/n/{guid}.html", new { controller = "Article", action = "Show" } ); #endregion #region == Search == context.MapRoute( "search_default", "search", new { controller = "Home", action = "Search" } ); context.MapRoute( "en_search_default", "en/search", new { controller = "Home", action = "Search" } ); #endregion #region == Default == context.MapRoute( "EnDefault", // Route name "en", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); context.MapRoute( "Default", // Route name "{controller}/{action}", // URL with parameters new { controller = "Home", action = "Index" }, // Parameter defaults new { controller = @"Home|Article|Channel|Download|Feedback|Survey" } ); #endregion }
public void MapRouteWithoutNamespaces() { // Arrange RouteCollection routes = new RouteCollection(); AreaRegistrationContext context = new AreaRegistrationContext("the_area", routes); // Act Route route = context.MapRoute("the_name", "the_url"); // Assert Assert.Equal(route, routes["the_name"]); Assert.Equal("the_area", route.DataTokens["area"]); Assert.Null(route.DataTokens["namespaces"]); Assert.Equal(true, route.DataTokens["UseNamespaceFallback"]); }
/// <summary> /// Registers ares. /// </summary> /// <param name="context">Area registration context.</param> public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute("System_default", "System/{controller}/{action}/{id}", new { id = UrlParameter.Optional }); }
public void ActionControllerAreaReference_WithUseRootInArea_RemoteFindsControllerInRoot() { // Arrange ModelMetadata metadata = ModelMetadataProviders.Current.GetMetadataForProperty(modelAccessor: null, containerType: typeof(string), propertyName: "Length"); TestableRemoteAttribute attribute = new TestableRemoteAttribute("Action", "Controller", AreaReference.UseRoot); attribute.HttpMethod = "POST"; var context = new AreaRegistrationContext("Test", attribute.RouteTable); context.MapRoute(name: null, url: "Test/{controller}/{action}"); attribute.RouteTable.Add(new Route("{controller}/{action}", new MvcRouteHandler())); // Act ModelClientValidationRule rule = attribute.GetClientValidationRules(metadata, GetMockControllerContextWithArea(url: null, areaName: "Test")) .Single(); // Assert Assert.Equal("remote", rule.ValidationType); Assert.Equal("/Controller/Action", rule.ValidationParameters["url"]); }
/// <summary> /// 注册路由 /// </summary> /// <param name="context"></param> public override void RegisterArea(AreaRegistrationContext context) { //对于IIS6.0默认配置不支持无扩展名的url string extensionForOldIIS = ".aspx"; int iisVersion = 0; if (!int.TryParse(ConfigurationManager.AppSettings["IISVersion"], out iisVersion)) { iisVersion = 7; } if (iisVersion >= 7) { extensionForOldIIS = string.Empty; } ISiteSettingsManager siteSettingsManager = DIContainer.Resolve <ISiteSettingsManager>(); SiteSettings siteSettings = siteSettingsManager.Get(); #region Channel context.MapRoute( "Channel_SiteHome", // Route name "", // URL with parameters new { controller = "Channel", action = siteSettings.EnableSimpleHome ? "SimpleHome" : "Home" } // Parameter defaults ); context.MapRoute( "Channel_Home", // Route name "Home" + extensionForOldIIS, // URL with parameters new { controller = "Channel", action = "Home", CurrentNavigationId = "1000001" } // Parameter defaults ); context.MapRoute( "Channel_SimpleHome", // Route name "SimpleHome" + extensionForOldIIS, // URL with parameters new { controller = "Channel", action = "SimpleHome" } // Parameter defaults ); context.MapRoute( "Channel_ShortUrl", "{alias}", new { controller = "Channel", action = "RedirectUrl" }, new { alias = @"([0-9a-zA-Z]{6})|(\{\d+\})" } ); context.MapRoute( "Channel_AnnouncementDetail", // Route name "Announcement/s-{announcementId}" + extensionForOldIIS, // URL with parameters new { controller = "Channel", action = "AnnouncementDetail" }, // Parameter defaults new { announcementId = @"(\d+)|(\{\d+\})" } ); context.MapRoute( "Channel_Account_Comon", // Route name "Account/{action}" + extensionForOldIIS, // URL with parameters new { controller = "Account", action = "Login" } // Parameter defaults ); context.MapRoute( "Channel_Common", // Route name "Channel/{action}" + extensionForOldIIS, // URL with parameters new { controller = "Channel" } // Parameter defaults ); context.MapRoute( "Channel_FindUser_Ranking", // Route name "FindUser/s-{sortBy}-{pageIndex}" + extensionForOldIIS, // URL with parameters new { controller = "FindUser", action = "Ranking" }, // Parameter defaults new { sortBy = @"(\w+)|(\{\w+\})", pageIndex = @"(\d+)|(\{\d+\})" } ); context.MapRoute( "Channel_FindUser", // Route name "FindUser/{action}" + extensionForOldIIS, // URL with parameters new { controller = "FindUser" } // Parameter defaults ); #endregion Channel #region UserSpace context.MapRoute( string.Format("ActivityDetail_{0}_FollowUser", TenantTypeIds.Instance().User()), // Route name "follow/activity/{ActivityId}" + extensionForOldIIS, // URL with parameters new { controller = "Channel", action = "_FollowUserActivity" } // Parameter defaults ); context.MapRoute( "UserSpace_SpaceHome", // Route name "u/{SpaceKey}" + extensionForOldIIS, // URL with parameters new { controller = "UserSpace", action = "SpaceHome", CurrentNavigationId = "11000102" } // Parameter defaults ); context.MapRoute( "UserSpace_MyHome", // Route name "u/{SpaceKey}/MyHome" + extensionForOldIIS, // URL with parameters new { controller = "UserSpace", action = "MyHome", CurrentNavigationId = "11000101" } // Parameter defaults ); context.MapRoute( "UserSpace_Profile", // Route name "u/{spaceKey}/Profile" + extensionForOldIIS, // URL with parameters new { controller = "UserSpace", action = "PersonalInformation", CurrentNavigationId = "11000103" } // Parameter defaults ); context.MapRoute( "UserSpace_InviteFriend", // Route name "u/{spaceKey}/InviteFriend" + extensionForOldIIS, // URL with parameters new { controller = "Follow", action = "InviteFriend" } // Parameter defaults ); context.MapRoute( "UserSpace_IdentificationResult", // Route name "u/{spaceKey}/MyIdentifications" + extensionForOldIIS, // URL with parameters new { controller = "UserSpace", action = "IdentificationResult" } // Parameter defaults ); context.MapRoute( "UserSpace_EditIdentification", // Route name "u/{spaceKey}/ApplyIdentification" + extensionForOldIIS, // URL with parameters new { controller = "UserSpace", action = "EditIdentification" } // Parameter defaults ); context.MapRoute( "UserSpace_Follow_Common", // Route name "u/{spaceKey}/Follow/{action}" + extensionForOldIIS, // URL with parameters new { controller = "Follow" } // Parameter defaults ); context.MapRoute( "UserSpace_MessageCenter_Common", // Route name "u/{SpaceKey}/MessageCenter/{action}" + extensionForOldIIS, // URL with parameters new { controller = "MessageCenter", action = "ListMessageSessions" } // Parameter defaults ); context.MapRoute( "UserSpace_Settings_EditUserProfile", // Route name "u/{SpaceKey}/Settings/EditUserProfile" + extensionForOldIIS, // URL with parameters new { controller = "UserSpaceSettings", action = "EditUserProfile" } // Parameter defaults ); context.MapRoute( "UserSpace_Settings_ManageApplications", // Route name "u/{SpaceKey}/Settings/ManageApplications" + extensionForOldIIS, // URL with parameters new { controller = "UserSpaceSettings", action = "ManageApplications" } // Parameter defaults ); context.MapRoute( "UserSpace_Settings_Common", // Route name "u/{SpaceKey}/Settings/{action}" + extensionForOldIIS, // URL with parameters new { controller = "UserSpaceSettings", action = "EditUserProfile" } // Parameter defaults ); context.MapRoute( "UserSpace_Honour_PointRecords", // Route name "u/{SpaceKey}/Honour/PointRecords" + extensionForOldIIS, // URL with parameters new { controller = "Honour", action = "ListPointRecords" } // Parameter defaults ); context.MapRoute( "UserSpace_Honour_PointRule", // Route name "u/{SpaceKey}/Honour/MyRank" + extensionForOldIIS, // URL with parameters new { controller = "Honour", action = "MyRank" } // Parameter defaults ); context.MapRoute( "UserSpace_Honour_Common", // Route name "u/{SpaceKey}/Honour/{action}" + extensionForOldIIS, // URL with parameters new { controller = "Honour", action = "MyRank" } // Parameter defaults ); context.MapRoute( "UserSpace_Common", // Route name "u/common/{spaceKey}/{action}" + extensionForOldIIS, // URL with parameters new { controller = "UserSpace" } // Parameter defaults ); #endregion UserSpace #region ControlPanel context.MapRoute( "ControlPanel_Home", // Route name "ControlPanel/Home" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanel", action = "Home", CurrentNavigationId = "20000000" } // Parameter defaults ); #region 运营 context.MapRoute( "ControlPanel_Operation_Home", // Route name "ControlPanel/Operation" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelOperation", action = "Home", CurrentNavigationId = "20000030" } // Parameter defaults ); context.MapRoute( "ControlPanel_Operation_ManageRecommendItems", // Route name "ControlPanel/Operation/ManageRecommendItems" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelOperation", action = "ManageRecommendItems", CurrentNavigationId = "20000032" } // Parameter defaults ); context.MapRoute( "ControlPanel_Operation_ManageRecommendUsers", // Route name "ControlPanel/Operation/ManageRecommendUsers" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelOperation", action = "ManageRecommendUsers", CurrentNavigationId = "20000033" } // Parameter defaults ); context.MapRoute( "ControlPanel_Operation_ManageLinks", // Route name "ControlPanel/Operation/ManageLinks" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelOperation", action = "ManageLinks", CurrentNavigationId = "20000034" } // Parameter defaults ); context.MapRoute( "ControlPanel_Operation_ManageAdvertisings", // Route name "ControlPanel/Operation/ManageAdvertisings" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelOperation", action = "ManageAdvertisings", CurrentNavigationId = "20000035" } // Parameter defaults ); context.MapRoute( "ControlPanel_Operation_ManageAnnouncements", // Route name "ControlPanel/Operation/ManageAnnouncements" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelOperation", action = "ManageAnnouncements", CurrentNavigationId = "20000036" } // Parameter defaults ); context.MapRoute( "ControlPanel_Operation_ManageAccountTypes", // Route name "ControlPanel/Operation/ManageAccountTypes" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelOperation", action = "ManageAccountTypes", CurrentNavigationId = "20000037" } // Parameter defaults ); context.MapRoute( "ControlPanel_Operation_ManagePointRecords", // Route name "ControlPanel/Operation/ManagePointRecords" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelOperation", action = "ManagePointRecords", CurrentNavigationId = "20000038" } // Parameter defaults ); context.MapRoute( "ControlPanel_Operation_ManageSearchedTerms", // Route name "ControlPanel/Operation/ManageSearchedTerms" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelOperation", action = "ManageSearchedTerms", CurrentNavigationId = "20000039" } // Parameter defaults ); context.MapRoute( "ControlPanel_Operation_ManageImpeachReports", // Route name "ControlPanel/Operation/ManageImpeachReports" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelOperation", action = "ManageImpeachReports", CurrentNavigationId = "20000040" } // Parameter defaults ); context.MapRoute( "ControlPanel_Operation_ManageOperationLogs", // Route name "ControlPanel/Operation/ManageOperationLogs" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelOperation", action = "ManageOperationLogs", CurrentNavigationId = "20000041" } // Parameter defaults ); context.MapRoute( "ControlPanel_Operation_ManageCustomMessage", // Route name "ControlPanel/Operation/ManageCustomMessage" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelOperation", action = "ManageCustomMessage", CurrentNavigationId = "20000075" } // Parameter defaults ); context.MapRoute( "ControlPanel_Operation_MassMessages", // Route name "ControlPanel/Operation/MassMessages" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelOperation", action = "MassMessages", CurrentNavigationId = "20000076" } // Parameter defaults ); context.MapRoute( "ControlPanel_Operation_Statistics", // Route name "ControlPanel/Operation/Statistics" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelOperation", action = "CNZZStatistics", CurrentNavigationId = "20000077" } // Parameter defaults ); context.MapRoute( "ControlPanel_Operation_Common", // Route name "ControlPanel/Operation/{action}" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelOperation", action = "ManagePointRecords" } // Parameter defaults ); #endregion #region 内容 context.MapRoute( "ControlPanel_Content_Home", // Route name "ControlPanel/Content" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelContent", action = "Home", CurrentNavigationId = "20000010" } // Parameter defaults ); context.MapRoute( "ControlPanel_Content_ManageTags", // Route name "ControlPanel/Content/ManageTags" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelContent", action = "ManageTags", CurrentNavigationId = "20000014" } // Parameter defaults ); context.MapRoute( "ControlPanel_Content_ManageSiteCategories", // Route name "ControlPanel/Content/ManageSiteCategories" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelContent", action = "ManageSiteCategories", CurrentNavigationId = "20000015" } // Parameter defaults ); context.MapRoute( "ControlPanel_Content_ManageUserCategories", // Route name "ControlPanel/Content/ManageUserCategories" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelContent", action = "ManageUserCategories", CurrentNavigationId = "20000016" } // Parameter defaults ); context.MapRoute( "ControlPanel_Content_ManageComments", // Route name "ControlPanel/Content/ManageComments" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelContent", action = "ManageComments", CurrentNavigationId = "20000017" } // Parameter defaults ); context.MapRoute( "ControlPanel_Content_Common", // Route name "ControlPanel/Content/{action}" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelContent" } // Parameter defaults ); #endregion #region 用户 context.MapRoute( "ControlPanel_User_Home", // Route name "ControlPanel/Users" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelUser", action = "Home", CurrentNavigationId = "20000020" } // Parameter defaults ); context.MapRoute( "ControlPanel_User_ManageUser", // Route name "ControlPanel/User/ManageUser" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelUser", action = "ManageUsers", CurrentNavigationId = "20000022" } // Parameter defaults ); context.MapRoute( "ControlPanel_User_ManageUserRoles", // Route name "ControlPanel/User/ManageUserRoles" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelUser", action = "ManageUserRoles", CurrentNavigationId = "20000023" } // Parameter defaults ); context.MapRoute( "ControlPanel_User_ManageRanks", // Route name "ControlPanel/User/ManageRanks" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelUser", action = "ManageRanks", CurrentNavigationId = "20000024" } // Parameter defaults ); context.MapRoute( "ControlPanel_User_ManageIdentifications", // Route name "ControlPanel/User/ManageIdentifications" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelUser", action = "ManageIdentifications", CurrentNavigationId = "20000025" } // Parameter defaults ); context.MapRoute( "ControlPanel_User_Common", // Route name "ControlPanel/User/{action}" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelUser", action = "ManageUsers" } // Parameter defaults ); #endregion #region 工具 context.MapRoute( "ControlPanel_Tool_Home", // Route name "ControlPanel/Tool" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelTool", action = "Home", CurrentNavigationId = "20000042" } // Parameter defaults ); context.MapRoute( "ControlPanel_Tool_ManageTask", // Route name "ControlPanel/Tool/ManageTasks" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelTool", action = "ManageTasks", CurrentNavigationId = "20000046" } // Parameter defaults ); context.MapRoute( "ControlPanel_Tool_UnloadAppDomain", // Route name "ControlPanel/Tool/UnloadAppDomain" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelTool", action = "UnloadAppDomain", CurrentNavigationId = "20000047" } // Parameter defaults ); context.MapRoute( "ControlPanel_Tool_ManageIndex", // Route name "ControlPanel/Tool/ManageIndex" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelTool", action = "ManageIndex", CurrentNavigationId = "20000044" } // Parameter defaults ); context.MapRoute( "ControlPanel_Tool_ResetCache", // Route name "ControlPanel/Tool/ResetCache" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelTool", action = "ResetCache", CurrentNavigationId = "20000045" } // Parameter defaults ); context.MapRoute( "ControlPanel_Tool_RebuildingThumbnails", // Route name "ControlPanel/Tool/RebuildingThumbnails" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelTool", action = "RebuildingThumbnails", CurrentNavigationId = "20000048" } // Parameter defaults ); context.MapRoute( "ControlPanel_Tool_Common", // Route name "ControlPanel/Tool/{action}" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelTool" } // Parameter defaults ); #endregion #region 设置 context.MapRoute( "ControlPanel_Settings_Home", // Route name "ControlPanel/Settings" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelSettings", action = "SiteSettings", CurrentNavigationId = "20000050" } // Parameter defaults ); context.MapRoute( "ControlPanel_Settings_ManagePointItems", // Route name "ControlPanel/Settings/ManagePointItems" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelSettings", action = "ManagePointItems", CurrentNavigationId = "20000052" } // Parameter defaults ); context.MapRoute( "ControlPanel_Settings_ManagePermissionItems", // Route name "ControlPanel/Settings/ManagePermissionItems" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelSettings", action = "ManagePermissionItems", CurrentNavigationId = "20000053" } // Parameter defaults ); context.MapRoute( "ControlPanel_Settings_ManagePrivacyItems", // Route name "ControlPanel/Settings/ManagePrivacyItems" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelSettings", action = "ManagePrivacyItems", CurrentNavigationId = "20000054" } // Parameter defaults ); context.MapRoute( "ControlPanel_Settings_ManageAuditItems", // Route name "ControlPanel/Settings/ManageAuditItems" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelSettings", action = "ManageAuditItems", CurrentNavigationId = "20000055" } // Parameter defaults ); context.MapRoute( "ControlPanel_Settings_SiteSettings", // Route name "ControlPanel/Settings/SiteSettings" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelSettings", action = "SiteSettings", CurrentNavigationId = "20000057" } // Parameter defaults ); context.MapRoute( "ControlPanel_Settings_UserSettings", // Route name "ControlPanel/Settings/UserSettings" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelSettings", action = "UserSettings", CurrentNavigationId = "20000058" } // Parameter defaults ); context.MapRoute( "ControlPanel_Settings_AttachmentSettings", // Route name "ControlPanel/Settings/AttachmentSettings" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelSettings", action = "AttachmentSettings", CurrentNavigationId = "20000059" } // Parameter defaults ); context.MapRoute( "ControlPanel_Settings_ManageEmails", // Route name "ControlPanel/Settings/ManageEmails" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelSettings", action = "ListOutbox", CurrentNavigationId = "20000060" } // Parameter defaults ); context.MapRoute( "ControlPanel_Settings_ManageEmailOtherSettings", // Route name "ControlPanel/Settings/ManageEmailOtherSettings" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelSettings", action = "ManageEmailOtherSettings", CurrentNavigationId = "20000060" } // Parameter defaults ); context.MapRoute( "ControlPanel_Settings_MessagesSettings", // Route name "ControlPanel/Settings/MessagesSettings" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelSettings", action = "MessagesSettings", CurrentNavigationId = "20000061" } // Parameter defaults ); context.MapRoute( "ControlPanel_Settings_ReminderSettings", // Route name "ControlPanel/Settings/ReminderSettings" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelSettings", action = "ReminderSettings", CurrentNavigationId = "20000062" } // Parameter defaults ); context.MapRoute( "ControlPanel_Settings_PauseSiteSettings", // Route name "ControlPanel/Settings/PauseSiteSettings" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelSettings", action = "PauseSiteSettings", CurrentNavigationId = "20000063" } // Parameter defaults ); context.MapRoute( "ControlPanel_Settings_ManageApplications", // Route name "ControlPanel/Settings/ManageApplications" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelSettings", action = "ManageApplications", CurrentNavigationId = "20000065" } // Parameter defaults ); context.MapRoute( "ControlPanel_Settings_ManageNavigations", // Route name "ControlPanel/Settings/ManageNavigations" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelSettings", action = "ManageNavigations", CurrentNavigationId = "20000066" } // Parameter defaults ); context.MapRoute( "ControlPanel_Settings_ManageThemes", // Route name "ControlPanel/Settings/ManageThemes" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelSettings", action = "ManageThemes", CurrentNavigationId = "20000067" } // Parameter defaults ); context.MapRoute( "ControlPanel_Settings_ManageAreas", // Route name "ControlPanel/Settings/ManageAreas" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelSettings", action = "ManageAreas", CurrentNavigationId = "20000071" } // Parameter defaults ); context.MapRoute( "ControlPanel_Settings_ManageSchools", // Route name "ControlPanel/Settings/ManageSchools" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelSettings", action = "ManageSchools", CurrentNavigationId = "20000072" } // Parameter defaults ); context.MapRoute( "ControlPanel_Settings_ManageEmotionCategories", // Route name "ControlPanel/Settings/ManageEmotionCategories" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelSettings", action = "ManageEmotionCategories", CurrentNavigationId = "20000073" } // Parameter defaults ); context.MapRoute( "ControlPanel_Settings_ManageSensitiveWords", // Route name "ControlPanel/Settings/ManageSensitiveWords" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelSettings", action = "ManageSensitiveWords", CurrentNavigationId = "20000074" } // Parameter defaults ); context.MapRoute( "ControlPanel_Settings_Common", // Route name "ControlPanel/Settings/{action}" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelSettings", action = "ManagePointItems", CurrentNavigationId = "20000050" } // Parameter defaults ); #endregion context.MapRoute( "ControlPanel_Common", // Route name "ControlPanel/{action}" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanel", action = "Home" } // Parameter defaults ); #endregion ControlPanel #region Handler context.Routes.MapHttpHandler <CaptchaHttpHandler>("Captcha", "Handlers/CaptchaImage.ashx"); context.Routes.MapHttpHandler <AttachmentAuthorizeHandler>("AttachmentAuthorize", "Handlers/AttachmentAuthorize.ashx"); context.Routes.MapHttpHandler <AttachmentDownloadHandler>("Attachment", "Handlers/Attachment.ashx"); context.Routes.MapHttpHandler <CustomStyleHandler>("CustomStyle", "Handlers/CustomStyle.ashx"); //context.Routes.MapHttpHandler<UserAvatarHandler>("UserAvatar", "Handlers/UserAvatar.ashx"); //context.Routes.MapHttpHandler<ImageHandler>("Image", "Handlers/Image.ashx"); //context.Routes.MapHttpHandler<LogoHandler>("Logo", "Handlers/Logo.ashx"); #endregion Handler }
public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute("Coordinator_default", "CheckinCoordinator/{controller}/{action}/{id}", new { controller = "CheckinCoordinator", action = "Dashboard", id = UrlParameter.Optional } ); }
public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute( "Admin_menu", "Admin/menu", new { Controller = "menu", action = "index", id = UrlParameter.Optional }, new[] { "PizzaHut.Areas.Admin.Controllers" } ); context.MapRoute( "Admin_user", "Admin/user", new { Controller = "user", action = "index", id = UrlParameter.Optional }, new[] { "PizzaHut.Areas.Admin.Controllers" } ); context.MapRoute( "Admin_orders", "Admin/orders", new { Controller = "orders", action = "index", id = UrlParameter.Optional }, new[] { "PizzaHut.Areas.Admin.Controllers" } ); context.MapRoute( "Admin_post", "admin/post", new { Controller = "post", action = "index", id = UrlParameter.Optional }, new[] { "PizzaHut.Areas.Admin.Controllers" } ); context.MapRoute( "Admin_topic", "Admin/topic", new { Controller = "topic", action = "index", id = UrlParameter.Optional }, new[] { "PizzaHut.Areas.Admin.Controllers" } ); context.MapRoute( "Admin_slider", "Admin/Slider", new { Controller = "Slider", action = "index", id = UrlParameter.Optional }, new[] { "PizzaHut.Areas.Admin.Controllers" } ); context.MapRoute( "Admin_category", "Admin/category", new { Controller = "Category", action = "Index", id = UrlParameter.Optional }, new[] { "PizzaHut.Areas.Admin.Controllers" } ); context.MapRoute( "Admin_contact", "Admin/contact", new { Controller = "contact", action = "index", id = UrlParameter.Optional }, new[] { "PizzaHut.Areas.Admin.Controllers" } ); context.MapRoute( "Admin_product", "Admin/product", new { Controller = "Products", action = "index", id = UrlParameter.Optional }, new[] { "PizzaHut.Areas.Admin.Controllers" } ); context.MapRoute( "Admin_clint_edit", "admin/info/{id}", new { Controller = "Dashboard", action = "Edit", id = UrlParameter.Optional }, new[] { "PizzaHut.Areas.Admin.Controllers" } ); context.MapRoute( "Admin_login", "Admin/login", new { Controller = "auth", action = "login", id = UrlParameter.Optional }, new[] { "PizzaHut.Areas.Admin.Controllers" } ); context.MapRoute( "Admin_logout", "Admin/logout", new { Controller = "auth", action = "logout", id = UrlParameter.Optional }, new[] { "PizzaHut.Areas.Admin.Controllers" } ); context.MapRoute( "statistics", "Admin/statistics", new { Controller = "Dashboard", action = "statistics", id = UrlParameter.Optional }, new[] { "PizzaHut.Areas.Admin.Controllers" } ); context.MapRoute( "Admin_default", "Admin/{controller}/{action}/{id}", new { Controller = "Dashboard", action = "Index", id = UrlParameter.Optional }, new[] { "PizzaHut.Areas.Admin.Controllers" } ); }
public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute("Admin.Forms", "admin/forms", FormsMVC.Forms.ShowAll(), new { httpVerbs = new HttpVerbConstraint(HttpVerbs.Get) }); context.MapRoute("Admin.Forms.DynamicGridData", "admin/forms/DynamicGridData", new { controller = "Forms", action = "DynamicGridData", id = String.Empty, area = AreaName }); context.MapRoute(null, "admin/form/permissions/{formId}", new { controller = "Forms", action = "ShowPermissions", area = AreaName, formId = UrlParameter.Optional }, new { httpVerbs = new HttpVerbConstraint(HttpVerbs.Get) }); context.MapRoute(null, "admin/forms/apply-permissions", FormsMVC.Forms.ApplyPermissions(), new { httpVerbs = new HttpVerbConstraint(HttpVerbs.Post) }); context.MapRoute(null, "admin/form/form-elements/{formId}", new { controller = "Forms", action = "ShowFormElements", area = AreaName, formId = UrlParameter.Optional }, new { httpVerbs = new HttpVerbConstraint(HttpVerbs.Get) }); context.MapRoute(null, "admin/form-{formId}/FormElementsDynamicGridData", new { controller = "Forms", action = "FormElementsDynamicGridData", id = String.Empty, area = AreaName }); context.MapRoute(null, "admin/forms/update-form-elements-positions", FormsMVC.Forms.UpdateFormElementPosition()); context.MapRoute(null, "admin/forms/edit-{formId}", new { controller = "Forms", action = "Edit", area = AreaName, formId = UrlParameter.Optional }, new { httpVerbs = new HttpVerbConstraint(HttpVerbs.Get) }); context.MapRoute("Admin.ChangeFormLanguage", "admin/forms/change-language", new { controller = "Forms", action = "ChangeLanguage", id = String.Empty }, new { httpVerbs = new HttpVerbConstraint(HttpVerbs.Post) }); context.MapRoute("Admin.SaveForm", "admin/forms/save", FormsMVC.Forms.Save(), new { httpVerbs = new HttpVerbConstraint(HttpVerbs.Post) }); context.MapRoute(null, "admin/forms/new", FormsMVC.Forms.New()); context.MapRoute("Admin.RemoveForm", "admin/forms/remove-{id}", FormsMVC.Forms.Remove()); context.MapRoute(null, "admin/form/new-element/{formId}", new { controller = "Forms", action = "NewElement", area = AreaName, formId = UrlParameter.Optional }); context.MapRoute(null, "admin/form-{formId}/edit-element-{formElementId}", new { controller = "Forms", action = "EditElement", area = AreaName, formId = UrlParameter.Optional, formElementId = UrlParameter.Optional }); context.MapRoute("Admin.ChangeFormElementLanguage", "admin/forms/form-element/change-language", new { controller = "Forms", action = "ChangeFormElementLanguage", id = String.Empty }, new { httpVerbs = new HttpVerbConstraint(HttpVerbs.Post) }); context.MapRoute("Admin.SaveFormElement", "admin/forms-{formId}/save-element", new { controller = "Forms", action = "SaveElement", id = String.Empty }, new { httpVerbs = new HttpVerbConstraint(HttpVerbs.Post) }); context.MapRoute("Admin.RemoveFormElement", "admin/forms-element/remove-{id}", FormsMVC.Forms.RemoveElement()); context.MapRoute(null, "admin/form-tabs", FormsMVC.Forms.FormTabs(), new { httpVerbs = new HttpVerbConstraint(HttpVerbs.Post) }); context.MapRoute("Admin.FormsAnswers", "admin/forms-answers", FormsMVC.FormAnswers.ShowAll(), new { httpVerbs = new HttpVerbConstraint(HttpVerbs.Get) }); context.MapRoute(null, "admin/forms-answers/DynamicGridData", FormsMVC.FormAnswers.FormAnswersDynamicGridData()); context.MapRoute("Admin.FormAnswers", "admin/form-answers/{formWidgetId}", new { controller = "FormAnswers", action = "ShowAnswers", area = AreaName, formWidgetId = UrlParameter.Optional }); context.MapRoute(null, "admin/forms-answer-details/{answerId}", new { controller = "FormAnswers", action = "ShowAnswerDetails", area = AreaName, answerId = UrlParameter.Optional }); //widget routs context.MapRoute(null, String.Empty, FormsMVC.FormsBuilderWidget.ViewWidget(), new { httpVerbs = new HttpVerbConstraint(HttpVerbs.Post) }); context.MapRoute(null, "form-widget/submit-form", FormsMVC.FormsBuilderWidget.SubmitWidgetForm(), new { httpVerbs = new HttpVerbConstraint(HttpVerbs.Post) }); context.MapRoute(null, String.Empty, FormsMVC.FormsBuilderWidget.EditWidget(), new { httpVerbs = new HttpVerbConstraint(HttpVerbs.Post) }); context.MapRoute(null, "form-widget/update", FormsMVC.FormsBuilderWidget.UpdateWidget(), new { httpVerbs = new HttpVerbConstraint(HttpVerbs.Post) }); }
private static RouteCollection GetRouteCollection() { RouteCollection routes = new RouteCollection(); routes.MapRoute( "Default", "no-area/{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "" } ); AreaRegistrationContext blogContext = new AreaRegistrationContext("blog", routes); blogContext.MapRoute( "Blog_WhatsNew", "whats-new/{tag}", new { controller = "Home", action = "TenMostRecent", tag = "" } ); blogContext.MapRoute( "Blog_Default", "blog-area/{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "" } ); AreaRegistrationContext adminContext = new AreaRegistrationContext("admin", routes); adminContext.MapRoute( "Admin_Default", "admin-area/{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "" } ); return routes; }
public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute( "Sale_SaleCategory", "SaleCategory/{action}/{id}", new { controller = "SaleCategory", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_Product", "Product/{action}/{id}", new { controller = "Product", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_Supplier", "Supplier/{action}/{id}", new { controller = "Supplier", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_Warehouse", "Warehouse/{action}/{id}", new { controller = "Warehouse", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_PurchaseOrder", "PurchaseOrder/{action}/{id}", new { controller = "PurchaseOrder", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_ProductInvoice", "ProductInvoice/{action}/{id}", new { controller = "ProductInvoice", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_Inventory", "Inventory/{action}/{id}", new { controller = "Inventory", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_ProductOutbound", "ProductOutbound/{action}/{id}", new { controller = "ProductOutbound", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_ProductInBound", "ProductInBound/{action}/{id}", new { controller = "ProductInBound", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_PhysicalInventory", "PhysicalInventory/{action}/{id}", new { controller = "PhysicalInventory", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_PhysicalInventoryDetail", "PhysicalInventoryDetail/{action}/{id}", new { controller = "PhysicalInventoryDetail", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_ObjectAttribute", "ObjectAttribute/{action}/{id}", new { controller = "ObjectAttribute", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sales_Commision", "Commision/{action}/{id}", new { controller = "Commision", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_vwCommision_Branch", "vwCommision_Branch/{action}/{id}", new { controller = "vwCommision_Branch", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_vwBranchDepartment", "vwBranchDepartment/{action}/{id}", new { controller = "vwBranchDepartment", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_SaleOrder", "SaleOrder/{action}/{id}", new { controller = "SaleOrder", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_SaleOrderDetail", "SaleOrderDetail/{action}/{id}", new { controller = "SaleOrderDetail", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_Report", "SaleReport/{action}/{id}", new { controller = "SaleReport", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_WarehouseLocationItem", "WarehouseLocationItem/{action}/{id}", new { controller = "WarehouseLocationItem", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_Promotion", "Promotion/{action}/{id}", new { controller = "Promotion", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_SalesReturns", "SalesReturns/{action}/{id}", new { controller = "SalesReturns", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_CommisionStaff", "CommisionStaff/{action}/{id}", new { controller = "CommisionStaff", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_TemplatePrint", "TemplatePrint/{action}/{id}", new { controller = "TemplatePrint", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_CommisionDetail", "CommisionDetail/{action}/{id}", new { controller = "CommisionDetail", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_Service", "Service/{action}/{id}", new { controller = "Service", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_UsingServiceLog", "UsingServiceLog/{action}/{id}", new { controller = "UsingServiceLog", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_RequestInbound", "RequestInbound/{action}/{id}", new { controller = "RequestInbound", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_RequestInboundDetail", "RequestInboundDetail/{action}/{id}", new { controller = "RequestInboundDetail", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_UsingServiceLogDetail", "UsingServiceLogDetail/{action}/{id}", new { controller = "UsingServiceLogDetail", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_ProductDamaged", "ProductDamaged/{action}/{id}", new { controller = "ProductDamaged", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_ServiceReminder", "ServiceReminder/{action}/{id}", new { controller = "ServiceReminder", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_ServiceReminderGroup", "ServiceReminderGroup/{action}/{id}", new { controller = "ServiceReminderGroup", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_LogServiceRemminder", "LogServiceRemminder/{action}/{id}", new { controller = "LogServiceRemminder", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_Commision_Customer", "CommisionCustomer/{action}/{id}", new { controller = "CommisionCustomer", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_ServiceSchedule", "ServiceSchedule/{action}/{id}", new { controller = "ServiceSchedule", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_LogLoyaltyPoint", "LogLoyaltyPoint/{action}/{id}", new { controller = "LogLoyaltyPoint", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_LoyaltyPoint", "LoyaltyPoint/{action}/{id}", new { controller = "LoyaltyPoint", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_CommissionCus", "CommissionCus/{action}/{id}", new { controller = "CommissionCus", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_TotalDiscountMoneyNT", "TotalDiscountMoneyNT/{action}/{id}", new { controller = "TotalDiscountMoneyNT", action = "Index", id = UrlParameter.Optional } ); context.MapRoute( "Sale_LogVip", "LogVip/{action}/{id}", new { controller = "LogVip", action = "Index", id = UrlParameter.Optional } ); //<append_content_route_here> RegisterAutoMapperMap(); }
public override void RegisterArea(AreaRegistrationContext context) { //对于IIS6.0默认配置不支持无扩展名的url string extensionForOldIIS = ".aspx"; int iisVersion = 0; if (!int.TryParse(ConfigurationManager.AppSettings["IISVersion"], out iisVersion)) { iisVersion = 7; } if (iisVersion >= 7) { extensionForOldIIS = string.Empty; } #region Channel context.MapRoute( "Channel_Topic_Home", // Route name "Topic" + extensionForOldIIS, // URL with parameters new { controller = "ChannelTopic", action = "Home", CurrentNavigationId = "10900202" } // Parameter defaults ); context.MapRoute( "Channel_Topic_Create", // Route name "Topic/Create" + extensionForOldIIS, // URL with parameters new { controller = "ChannelTopic", action = "Create" } // Parameter defaults ); context.MapRoute( "Channel_Topic_UserTopics", // Route name "Topic/u-{spaceKey}" + extensionForOldIIS, // URL with parameters new { controller = "ChannelTopic", action = "UserJoinedTopics", CurrentNavigationId = "10900203" } ); context.MapRoute( "Channel_Topic_FindTopic", // Route name "Topic/FindTopic" + extensionForOldIIS, // URL with parameters new { controller = "ChannelTopic", action = "FindTopic", CurrentNavigationId = "10900204" } ); context.MapRoute( "Channel_Topic_Created", // Route name "Topic/u-{spaceKey}/Created" + extensionForOldIIS, // URL with parameters new { controller = "ChannelTopic", action = "UserCreatedTopics", CurrentNavigationId = "10900203" } ); context.MapRoute( "Channel_Topic_Tag", // Route name "Topic/t-{tagName}" + extensionForOldIIS, // URL with parameters new { controller = "ChannelTopic", action = "ListByTag" } // Parameter defaults ); context.MapRoute( "Channel_Topic_Common", // Route name "Topic/{action}" + extensionForOldIIS, // URL with parameters new { controller = "ChannelTopic" } // Parameter defaults ); #endregion #region TopicActivity context.MapRoute( string.Format("ActivityDetail_{0}_CreateTopic", TenantTypeIds.Instance().Topic()), // Route name "TopicActivity/CreateThread/{ActivityId}" + extensionForOldIIS, // URL with parameters new { controller = "ChannelTopic", action = "_CreateTopic" } // Parameter defaults ); context.MapRoute( string.Format("ActivityDetail_{0}_CreateTopicMember", TenantTypeIds.Instance().User()), // Route name "TopicActivity/CreateTopicMember/{ActivityId}" + extensionForOldIIS, // URL with parameters new { controller = "ChannelTopic", action = "_CreateTopicMember" } // Parameter defaults ); context.MapRoute( string.Format("ActivityDetail_{0}_JoinTopic", TenantTypeIds.Instance().User()), // Route name "TopicActivity/JoinTopic/{ActivityId}" + extensionForOldIIS, // URL with parameters new { controller = "ChannelTopic", action = "_JoinTopic" } // Parameter defaults ); #endregion #region TopicSpace context.MapRoute( "TopicSpace_Member", // Route name "t/{SpaceKey}/Members" + extensionForOldIIS, // URL with parameters new { controller = "TopicSpace", action = "Members", CurrentNavigationId = "13900280" } // Parameter defaults ); #endregion #region TopicSpaceTheme //专题空间首页 context.MapRoute( "TopicSpaceTheme_Home", // Route name "t/{SpaceKey}" + extensionForOldIIS, // URL with parameters new { controller = "TopicSpaceTheme", action = "Home", CurrentNavigationId = "13900201" } // Parameter defaults ); context.MapRoute( "TopicSpaceTheme_Common", // Route name "Topictheme/{SpaceKey}/{action}" + extensionForOldIIS, // URL with parameters new { controller = "TopicSpaceTheme", action = "Home" } // Parameter defaults ); #endregion #region TopicSettings context.MapRoute( "TopicSpace_Settings_Common", // Route name "t/{SpaceKey}/settings/{action}" + extensionForOldIIS, // URL with parameters new { controller = "TopicSpaceSettings", action = "ManageMembers" } // Parameter defaults ); #endregion context.MapRoute( "TopicSpace_Common", // Route name "t/{SpaceKey}/{action}" + extensionForOldIIS, // URL with parameters new { controller = "TopicSpace", action = "Home" } // Parameter defaults ); #region ControlPanel context.MapRoute( "ControlPanel_Topic_Home", // Route name "ControlPanelTopic/ManageTopics" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelTopic", action = "ManageTopics", CurrentNavigationId = "20900201", tenantTypeId = TenantTypeIds.Instance().Topic() } // Parameter defaults ); context.MapRoute( "ControlPanel_Topic_Common", // Route name "ControlPanelTopic/{action}" + extensionForOldIIS, // URL with parameters new { controller = "ControlPanelTopic", CurrentNavigationId = "20900210" } // Parameter defaults ); #endregion }
public override void RegisterArea(AreaRegistrationContext context) { // R1 context.MapRoute( name: null, url: "Reports/R1/SaveDocsRetComm/{*pathInfo}", defaults: new { controller = "R1", action = "SaveDocsRetComm" } ); context.MapRoute( name: null, url: "Reports/R1/GetClientSelector/{*pathInfo}", defaults: new { controller = "R1", action = "GetClientSelector" } ); context.MapRoute( name: null, url: "Reports/R1/GetManagerSelector/{*pathInfo}", defaults: new { controller = "R1", action = "GetManagerSelector" } ); context.MapRoute( name: null, url: "Reports/R1/GetReport/{*pathInfo}", defaults: new { controller = "R1", action = "GetReport" } ); context.MapRoute( name: null, url: "Reports/R1/{*pathInfo}", defaults: new { controller = "R1", action = "Index" } ); // R2 context.MapRoute( name: null, url: "Reports/R2/GetEmploeeSelector/{*pathInfo}", defaults: new { controller = "R2", action = "GetEmploeeSelector" } ); context.MapRoute( name: null, url: "Reports/R2/GetReport/{*pathInfo}", defaults: new { controller = "R2", action = "GetReport" } ); context.MapRoute( name: null, url: "Reports/R2/{*pathInfo}", defaults: new { controller = "R2", action = "Index" } ); // Sud context.MapRoute( name: null, url: "Reports/Sud/UpsertSud/{*pathInfo}", defaults: new { controller = "Sud", action = "UpsertSud" } ); // R3 context.MapRoute( name: null, url: "Reports/R3/ApplyFilter/{*pathInfo}", defaults: new { controller = "R3", action = "ApplyFilter" } ); context.MapRoute( name: null, url: "Reports/R3/ApplyPeriod/{*pathInfo}", defaults: new { controller = "R3", action = "ApplyPeriod" } ); context.MapRoute( name: null, url: "Reports/R3/GetHistory/{*pathInfo}", defaults: new { controller = "R3", action = "GetHistory" } ); context.MapRoute( name: null, url: "Reports/R3/{*pathInfo}", defaults: new { controller = "R3", action = "Index" } ); }