public void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.html/{*pathInfo}"); // Notice: // Put all custom MapRoute above default. routes.MapLocalizedRoute("HomePage", // Route name "", // URL with parameters new { controller = "Home", action = "Index"}, // Parameter defaults new[] { "Aaron.Web.Controllers" } ); //topic routes.MapLocalizedRoute("Topic", "{SystemName}", new { controller = "Topic", action = "TopicDetails" }, new[] { "Aaron.Web.Controllers" }); routes.MapLocalizedRoute("TopicAuthenticate", "topic/authenticate", new { controller = "Topic", action = "Authenticate" }, new[] { "Aaron.Web.Controllers" }); //robots.txt routes.MapLocalizedRoute("robots.txt", "r/robots.txt", new { controller = "Common", action = "RobotsTextFile" }, new[] { "Aaron.Web.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { //generic URLs routes.MapGenericPathRoute("GenericUrl", "{generic_se_name}", new {controller = "Common", action = "GenericUrl"}, new[] {"Nop.Web.Controllers"}); //define this routes to use in UI views (in case if you want to customize some of them later) routes.MapLocalizedRoute("Product", "{SeName}", new {controller = "Catalog", action = "Product"}, new[] {"Nop.Web.Controllers"}); routes.MapLocalizedRoute("Category", "{SeName}", new { controller = "Catalog", action = "Category" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("Manufacturer", "{SeName}", new { controller = "Catalog", action = "Manufacturer" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("NewsItem", "{SeName}", new { controller = "News", action = "NewsItem" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("BlogPost", "{SeName}", new { controller = "Blog", action = "BlogPost" }, new[] { "Nop.Web.Controllers" }); }
public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapLocalizedRoute("HomePage", "", new { controller = "Home", action = "Index" }, new[] { "Clean.Web.Controllers" } ); routes.MapLocalizedRoute("ChangeLang", "changelanguage", new { controller = "Common", action = "SetLanguage" }, new[] { "Clean.Web.Controllers" } ); routes.MapLocalizedRoute("Logout", "logout", new { controller = "Account", action = "Logout" }, new[] { "Clean.Web.Controllers" } ); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); }
public void RegisterRoutes(RouteCollection routes) { //generic URLs routes.MapGenericPathRoute("GenericUrl", "{generic_se_name}", new { controller = "Common", action = "GenericUrl" }, new[] { "Nop.Web.Controllers" }); //define this routes to use in UI views (in case if you want to customize some of them later) routes.MapLocalizedRoute("Product", "{SeName}", new { controller = "Catalog", action = "Product" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("Category", "{SeName}", new { controller = "Catalog", action = "Category" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("Manufacturer", "{SeName}", new { controller = "Catalog", action = "Manufacturer" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("NewsItem", "{SeName}", new { controller = "News", action = "NewsItem" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("BlogPost", "{SeName}", new { controller = "Blog", action = "BlogPost" }, new[] { "Nop.Web.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { //generic URLs routes.MapGenericPathRoute("GenericUrl", "{*generic_se_name}", new { controller = "Common", action = "GenericUrl" }, new[] { "CAF.WebSite.Mvc.Controllers" }); // Routes solely needed for URL creation, NOT for route matching. routes.MapLocalizedRoute("Article", "{SeName}", new { controller = "Article", action = "Article" }, new[] { "CAF.WebSite.Mvc.Controllers" }); routes.MapLocalizedRoute("ArticleCategory", "{SeName}", new { controller = "ArticleCatalog", action = "Category" }, new[] { "CAF.WebSite.Mvc.Controllers" }); //routes.MapLocalizedRoute("Topic", // "{SeName}", // new { controller = "Topic", action = "Topic" }, // new[] { "CAF.WebSite.Mvc.Controllers" }); // TODO: actually this one's never reached, because the "GenericUrl" route // at the top handles this. routes.MapLocalizedRoute("PageNotFound", "{*path}", new { controller = "Error", action = "NotFound" }, new[] { "CAF.WebSite.Mvc.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { //products routes.MapLocalizedRoute("", "p/{productId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectProductById", SeName = UrlParameter.Optional }, new { productId = @"\d+" }, new[] { "Nas.Web.Controllers" }); //categories routes.MapLocalizedRoute("", "c/{categoryId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectCategoryById", SeName = UrlParameter.Optional }, new { categoryId = @"\d+" }, new[] { "Nas.Web.Controllers" }); //manufacturers routes.MapLocalizedRoute("", "m/{manufacturerId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectManufacturerById", SeName = UrlParameter.Optional }, new { manufacturerId = @"\d+" }, new[] { "Nas.Web.Controllers" }); //news routes.MapLocalizedRoute("", "news/{newsItemId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectNewsItemById", SeName = UrlParameter.Optional }, new { newsItemId = @"\d+" }, new[] { "Nas.Web.Controllers" }); //blog routes.MapLocalizedRoute("", "blog/{blogPostId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectBlogPostById", SeName = UrlParameter.Optional }, new { blogPostId = @"\d+" }, new[] { "Nas.Web.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { try { routes.Add("WorkflowRoute", new System.Web.Routing.Route("Workflow/{page}.aspx/{*path}", routeHandler: new PluginRouteHandler())); routes.MapLocalizedRoute("Workflow.eForm.Index", "Workflow/eForm", new { controller = "eForm", action = "Index", }, new[] { "AgileEAP.Plugin.Workflow.Controllers" }); routes.MapLocalizedRoute("Workflow.Process.Tracking", "Workflow/Process/Tracking", new { controller = "Design", action = "DrawWorkflow", }, new[] { "AgileEAP.Plugin.Workflow.Controllers" }); routes.MapRoute("Workflow.Default.Route", "Workflow/{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional }, new[] { "AgileEAP.Plugin.Workflow.Controllers" }); } catch (Exception ex) { GlobalLogger.Error<RouteProvider>("初始化插件Workflow路由出错{0}", ex); } }
public void RegisterRoutes(RouteCollection routes) { //products routes.MapLocalizedRoute("", "p/{productId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectProductById", SeName = UrlParameter.Optional }, new { productId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //categories routes.MapLocalizedRoute("", "c/{categoryId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectCategoryById", SeName = UrlParameter.Optional }, new { categoryId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //manufacturers routes.MapLocalizedRoute("", "m/{manufacturerId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectManufacturerById", SeName = UrlParameter.Optional }, new { manufacturerId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //news routes.MapLocalizedRoute("", "news/{newsItemId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectNewsItemById", SeName = UrlParameter.Optional }, new { newsItemId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //blog routes.MapLocalizedRoute("", "blog/{blogPostId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectBlogPostById", SeName = UrlParameter.Optional }, new { blogPostId = @"\d+" }, new[] { "Nop.Web.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { //index routes.MapLocalizedRoute("HomePage", "index/", new { controller = "Home", action = "Index" }, new[] { "Explore.Web.Controllers" }); //login routes.MapLocalizedRoute("Login", "login/", new { controller = "User", action = "Login" }, new[] { "Explore.Web.Controllers" }); //register routes.MapLocalizedRoute("Register", "register/", new { controller = "User", action = "Register" }, new[] { "Explore.Web.Controllers" }); //注册结果页 routes.MapLocalizedRoute("RegisterResult", "registerresult/{resultId}", new { controller = "User", action = "RegisterResult" }, new { resultId = @"\d+" }, new[] { "Explore.Web.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { //generic URLs routes.MapGenericPathRoute("GenericUrl", "{generic_se_name}", new { controller = "Common", action = "GenericUrl" }, new[] { "TinyCms.Web.Controllers" }); //define this routes to use in UI views (in case if you want to customize some of them later) routes.MapLocalizedRoute("Post", "{SeName}", new { controller = "Post", action = "PostDetails" }, new[] { "TinyCms.Web.Controllers" }); routes.MapLocalizedRoute("Category", "{SeName}", new { controller = "Posts", action = "Category" }, new[] { "TinyCms.Web.Controllers" }); routes.MapLocalizedRoute("Topic", "{SeName}", new { controller = "Topic", action = "TopicDetails" }, new[] { "TinyCms.Web.Controllers" }); //the last route. it's used when none of registered routes could be used for the current request //but it this case we cannot process non-registered routes (/controller/action) //routes.MapLocalizedRoute( // "PageNotFound-Wildchar", // "{*url}", // new { controller = "Common", action = "PageNotFound" }, // new[] { "TinyCms.Web.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { //home page routes.MapLocalizedRoute("Home_Index", "", new { controller = "Home", action = "Index" }, new[] { "AgileEAP.Web.Controllers" }); routes.MapRoute( "DenyAccess", // Route name "DenyAccess/", // URL with parameters new { controller = "Authorize", action = "DenyAccess" }, new[] { "AgileEAP.Web.Controllers" } ); //login, register routes.MapLocalizedRoute("Login", "login", new { controller = "Authorize", action = "Login" }, new[] { "AgileEAP.Web.Controllers" }); routes.MapLocalizedRoute("Logout", "logout/", new { controller = "Authorize", action = "Logout" }, new[] { "AgileEAP.Web.Controllers" }); routes.MapLocalizedRoute("Navigate", "Navigate/", new { controller = "Home", action = "Navigate" }, new[] { "AgileEAP.Web.Controllers" }); //routes.MapLocalizedRoute("Register", // "register/", // new { controller = "Authorize", action = "Register" }, // new[] { "AgileEAP.Web.Controllers" }); //routes.MapLocalizedRoute("RegisterResult", // "registerresult/{resultId}", // new { controller = "Authorize", action = "RegisterResult" }, // new { resultId = @"\d+" }, // new[] { "AgileEAP.Web.Controllers" }); ////contact us //routes.MapLocalizedRoute("ContactUs", // "contactus", // new { controller = "Common", action = "ContactUs" }, // new[] { "AgileEAP.Web.Controllers" }); ////passwordrecovery //routes.MapLocalizedRoute("PasswordRecovery", // "passwordrecovery", // new { controller = "Customer", action = "PasswordRecovery" }, // new[] { "AgileEAP.Web.Controllers" }); //routes.MapLocalizedRoute("PasswordRecoveryConfirm", // "passwordrecovery/confirm", // new { controller = "Customer", action = "PasswordRecoveryConfirm" }, // new[] { "AgileEAP.Web.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { var route = routes.MapRoute("Plugin.Misc.GroupDeals.Areas.Vendor.GroupDealsController", "Vendor/GroupDeals/{action}/{id}", new { area = "Vendor", controller = "GroupDeals", action = "Index", id = UrlParameter.Optional }, new[] { "Nop.Plugin.Misc.GroupDeals.Areas.Vendor.Controllers" } ); routes.Remove(route); routes.Insert(0, route); route = routes.MapRoute("Plugin.Misc.GroupDeals.Areas.Admin.GroupDealsController", "Admin/GroupDeals/{action}/{id}", new { area = "Admin", controller = "GroupDeals", action = "Index", id = UrlParameter.Optional }, new[] { "Nop.Plugin.Misc.GroupDeals.Areas.Admin.Controllers" } );//.DataTokens.Add("area", "Admin") routes.Remove(route); routes.Insert(0, route); route = routes.MapRoute("Plugin.Misc.GroupDeals.Areas.Public.GroupDealsController", "GroupDeals/{action}/{id}", new { controller = "GroupDeals", action = "Index", id = UrlParameter.Optional }, new[] { "Nop.Plugin.Misc.GroupDeals.Areas.Public.Controllers" } ); routes.Remove(route); routes.Insert(0, route); route = routes.MapRoute("Plugin.Misc.GroupDeals.Areas.Public.GdShoppingCartController", "GdShoppingCart/{action}", new { controller = "GdShoppingCart", action = "Cart" }, new[] { "Nop.Plugin.Misc.GroupDeals.Areas.Public.Controllers" } ); routes.Remove(route); routes.Insert(0, route); //add groupdeal to cart (without any attributes and options). used on catalog pages. route = routes.MapLocalizedRoute("AddGroupDealToCart-Catalog", "addgroupdealtocart/catalog/{groupDealId}/{shoppingCartTypeId}/{quantity}", new { controller = "GdShoppingCart", action = "AddGroupDealToCart_Catalog" }, new { groupDealId = @"\d+", shoppingCartTypeId = @"\d+", quantity = @"\d+" }, new[] { "Nop.Plugin.Misc.GroupDeals.Areas.Public.Controllers" }); routes.Remove(route); routes.Insert(0, route); //add groupdeal to cart (with attributes and options). used on the groupdeal details pages. route = routes.MapLocalizedRoute("AddGroupDealToCart-Details", "addgroupdealtocart/details/{groupDealId}/{shoppingCartTypeId}", new { controller = "GdShoppingCart", action = "AddGroupDealToCart_Details" }, new { groupDealId = @"\d+", shoppingCartTypeId = @"\d+" }, new[] { "Nop.Plugin.Misc.GroupDeals.Areas.Public.Controllers" }); routes.Remove(route); routes.Insert(0, route); ViewEngines.Engines.Insert(0, new CustomViewEngine()); }
public void RegisterRoutes(RouteCollection routes) { // System.Web.Mvc.ViewEngines.Engines.Insert(0, new CustomViewEngine()); routes.MapLocalizedRoute("BsProductVideo.ProductList", "product-video/product-list", new { controller = "ProductVideo", action = "List", area = "" }, new[] { "Nop.Plugin.Widgets.BsProductVideo.Controllers" }); routes.MapLocalizedRoute("BsProductVideo.VideoCreate", "product-video/create/{productId}", new { controller = "ProductVideo", action = "VideoCreate", productId = UrlParameter.Optional, area = "" }, new[] { "Nop.Plugin.Widgets.BsProductVideo.Controllers" }); }
public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapLocalizedRoute("SeoFriendlyUrl", "{SeoFriendlyName}", new { controller = "Company", action = "Index" }, new[] { "DynamicRoutingExample.Controllers" }); routes.MapRoute( "Slug", // Route name "pages/{slug}", // URL with parameters new { controller = "Home", action = "Content" } // Parameter defaults ); routes.MapRoute( "task", // Route name "tasks/{task}", // URL with parameters new { controller = "Home", action = "Content" } // Parameter defaults ); routes.MapRoute( name: "Default", url: "admin/{controller}/{action}", defaults: new { controller = "Account", action = "Index" } ); routes.MapRoute( name: "admin", url: "admin/{controller}/{action}/{id}", defaults: new { controller = "Account", action = "Index", id = UrlParameter.Optional } ); }
public void RegisterRoutes(RouteCollection routes) { routes.MapLocalizedRoute("BsProductLocation.ProductList", "product-location/product-list", new { controller = "ProductLocation", action = "List", area = "" }, new[] { "Nop.Plugin.Widgets.BsProductLocation.Controllers" }); routes.MapLocalizedRoute("BsProductLocation.LocationCreate", "product-location/create/{productId}", new { controller = "ProductLocation", action = "LocationCreate", productId = UrlParameter.Optional, area = "" }, new[] { "Nop.Plugin.Widgets.BsProductLocation.Controllers" }); routes.MapLocalizedRoute("BsProductLocation.SearchByServiceArea", "productsbysa/{id}", new { controller = "ProductLocation", action = "ProductsByServiceArea", area = "" }, new[] { "Nop.Plugin.Widgets.BsProductLocation.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { // TODO: actually this one's never reached, because the "GenericUrl" routes handles this. routes.MapLocalizedRoute("PageNotFound", "{*path}", new { controller = "Error", action = "NotFound" }, new[] { "SmartStore.Web.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { routes.MapLocalizedRoute("MyTestUrl", "que-huong/hahaha", new { controller = "Canada", action = "Index" }, new[] { "Research.Plugin.Shipping.CanadaPost.Controllers" } ); }
public void RegisterRoutes(RouteCollection routes) { //login routes.MapLocalizedRoute("Login", "login/", new { controller = "Customer", action = "Login" }, new[] { "LCL.Plugin.Rbac.Controllers" }); //register routes.MapLocalizedRoute("Register", "register/", new { controller = "Customer", action = "Register" }, new[] { "LCL.Plugin.Rbac.Controllers" }); //logout routes.MapLocalizedRoute("Logout", "logout/", new { controller = "Customer", action = "Logout" }, new[] { "LCL.Plugin.Rbac.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { routes.MapLocalizedRoute("NEXT_RECIPIENT", "checkout/RecepientAddress/{recepientId}", new { controller = "Checkout", action = "ShippingAddress", recepientId = UrlParameter.Optional }, new { recepientId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("REVIEW_SHIPPINGORDER_ACTION", "checkout/ShippingAddressesReview/", new { controller = "ShoppingCart", action = "ShippingOrderReview" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PAYMENT_PROCESS", "checkout/PaymentProcess/", new { controller = "Checkout", action = "OrderBillingAddress" }, new[] { "Nop.Web.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { //We reordered our routes so the most used ones are on top. It can improve performance. //home page routes.MapLocalizedRoute("HomePage", "", new { controller = "Home", action = "Index" }, new[] { "Nut.Web.Controllers" }); //login routes.MapLocalizedRoute("Login", "login/", new { controller = "User", action = "Login" }, new[] { "Nut.Web.Controllers" }); //register routes.MapLocalizedRoute("Register", "register/", new { controller = "User", action = "Register" }, new[] { "Nut.Web.Controllers" }); //logout routes.MapLocalizedRoute("Logout", "logout/", new { controller = "User", action = "Logout" }, new[] { "Nut.Web.Controllers" }); //install routes.MapRoute("Installation", "install", new { controller = "Install", action = "Index" }, new[] { "Nut.Web.Controllers" }); //License routes.MapRoute("License", "License", new { controller = "License", action = "Index" }, new[] { "Nut.Web.Controllers" }); //page not found routes.MapLocalizedRoute("PageNotFound", "page-not-found", new { controller = "Common", action = "PageNotFound" }, new[] { "Nut.Web.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { var idConstraint = new MinRouteConstraint(1); routes.MapLocalizedRoute("DynamicStart", "dynamiccaptcha/start", new { controller = "DynamicCaptcha", action = "CaptchaStart", numberOfImages = UrlParameter.Optional }, new[] { "CAF.WebSite.Application.WebUI.DynamicCaptcha" }); routes.MapLocalizedRoute("Image", "dynamiccaptcha/image", new { controller = "DynamicCaptcha", action = "CaptchaImage", imageIndex = UrlParameter.Optional }, new[] { "CAF.WebSite.Application.WebUI.DynamicCaptcha" }); routes.MapLocalizedRoute("Audio", "dynamiccaptcha/audio", new { controller = "DynamicCaptcha", action = "CaptchaAudio", index = UrlParameter.Optional }, new[] { "CAF.WebSite.Application.WebUI.DynamicCaptcha" }); }
public void RegisterRoutes(RouteCollection routes) { // override the nopCommerce customer profile route /*routes.MapGenericPathRoute("CustomerProfileSlug", * "{generic_se_name}", * new { controller = "Common", action = "GenericUrl" }, * new[] { "Nop.Web.Controllers" }); */ // for use in views routes.MapLocalizedRoute("CustomerProfileUrl", "{SeName}", new { controller = "Profile", action = "Index" }, new[] { "Nop.Web.Controllers" }); // for use in views routes.MapLocalizedRoute("EventPageUrl", "{SeName}", new { controller = "EventPage", action = "Index" }, new[] { "Nop.Plugin.Widgets.MobSocial.Controllers" }); // for use in views routes.MapLocalizedRoute("BusinessPageUrl", "{SeName}", new { controller = "BusinessPage", action = "Index" }, new[] { "Nop.Plugin.Widgets.MobSocial.Controllers" }); routes.MapLocalizedRoute("ArtistPageUrl", "{SeName}", new { controller = "ArtistPage", action = "Index" }, new[] { "Nop.Plugin.Widgets.MobSocial.Controllers" } ); routes.MapLocalizedRoute("SongUrl", "{SeName}", new { controller = "Song", action = "Index" }, new[] { "Nop.Plugin.Widgets.MobSocial.Controllers" } ); }
public void RegisterRoutes(RouteCollection routes) { try { routes.MapLocalizedRoute("FormDesigner.Default.FormDesigner", "FormDesigner", new { controller = "Home", action = "FormDesigner" }, new[] { "AgileEAP.Plugin.FormDesigner.Controllers" }); routes.MapLocalizedRoute("FormDesigner.Default.Route", "FormDesigner/{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional }, new[] { "AgileEAP.Plugin.FormDesigner.Controllers" }); } catch (Exception ex) { GlobalLogger.Error<RouteProvider>("初始化插件AgileEAP.Plugin.FormDesigner路由出错{0}", ex); } }
public void RegisterRoutes(RouteCollection routes) { var route = routes.MapLocalizedRoute("ProductSearch", "search/", new { controller = "GsaSearch", action = "Search" }, new[] { "Nop.Search.Plugin.GSA.Controllers" }); routes.Remove(route); routes.Add(route); }
public void RegisterRoutes(RouteCollection routes) { //generic URLs routes.MapGenericPathRoute("GenericUrl", "{generic_se_name}", new {controller = "Common", action = "GenericUrl"}, new[] {"Nop.Web.Controllers"}); //define this routes to use in UI views (in case if you want to customize some of them later) routes.MapLocalizedRoute("Product", "{SeName}", new {controller = "Catalog", action = "Product"}, new[] {"Nop.Web.Controllers"}); routes.MapLocalizedRoute("Category", "{SeName}", new { controller = "Catalog", action = "Category" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("Manufacturer", "{SeName}", new { controller = "Catalog", action = "Manufacturer" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("NewsItem", "{SeName}", new { controller = "News", action = "NewsItem" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("BlogPost", "{SeName}", new { controller = "Blog", action = "BlogPost" }, new[] { "Nop.Web.Controllers" }); //the last route. it's used when none of registered routes could be used for the current request //but it this case we cannot process non-registered routes (/controller/action) //routes.MapLocalizedRoute( // "PageNotFound-Wildchar", // "{*url}", // new { controller = "Common", action = "PageNotFound" }, // new[] { "Nop.Web.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { System.Web.Mvc.ViewEngines.Engines.Add(new CustomViewEngine()); routes.Remove(routes["ApplyVendorAccount"]); routes.MapLocalizedRoute("ApplyVendorAccount", "vendor/apply", new { controller = "Vendor", action = "ApplyVendor" }, new[] { "Nop.Plugin.Pages.OneStepApplyVendor.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { //generic URLs routes.MapGenericPathRoute("GenericUrl", "{*generic_se_name}", new { controller = "Common", action = "GenericUrl" }, new[] { "SmartStore.Web.Controllers" }); // Routes solely needed for URL creation, NOT for route matching. routes.MapLocalizedRoute("Product", "{SeName}", new { controller = "Product", action = "Product" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("Category", "{SeName}", new { controller = "Catalog", action = "Category" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("Manufacturer", "{SeName}", new { controller = "Catalog", action = "Manufacturer" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("NewsItem", "{SeName}", new { controller = "News", action = "NewsItem" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("BlogPost", "{SeName}", new { controller = "Blog", action = "BlogPost" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("PageNotFound", "{*path}", new { controller = "Error", action = "NotFound" }, new[] { "SmartStore.Web.Controllers" }); }
public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapLocalizedRoute("SeoFriendlyUrl", "{SeoFriendlyName}", new { controller = "Company", action = "Index" }, new[] { "DynamicRoutingExample.Controllers" }); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); }
public void RegisterRoutes(RouteCollection routes) { try { routes.MapLocalizedRoute("DatabaseStudio.Default.Route", "DatabaseStudio/{action}/{id}", new { plugin = "AgileEAP.Plugin.DatabaseStudio", controller = "Home", action = "Index", id = UrlParameter.Optional }, new[] { "AgileEAP.Plugin.DatabaseStudio.Controllers" }); } catch (Exception ex) { GlobalLogger.Error<RouteProvider>("初始化插件AgileEAP.Plugin.DatabaseStudio路由出错{0}", ex); } }
public void RegisterRoutes(RouteCollection routes) { var supportPreviousNopcommerceVersions = !String.IsNullOrEmpty(ConfigurationManager.AppSettings["SupportPreviousNopcommerceVersions"]) && Convert.ToBoolean(ConfigurationManager.AppSettings["SupportPreviousNopcommerceVersions"]); if (!supportPreviousNopcommerceVersions) { return; } //products routes.MapLocalizedRoute("", "p/{productId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectProductById", SeName = UrlParameter.Optional }, new { productId = @"\d+" }, new[] { "TinyCms.Web.Controllers" }); //categories routes.MapLocalizedRoute("", "c/{categoryId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectCategoryById", SeName = UrlParameter.Optional }, new { categoryId = @"\d+" }, new[] { "TinyCms.Web.Controllers" }); //manufacturers routes.MapLocalizedRoute("", "m/{manufacturerId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectManufacturerById", SeName = UrlParameter.Optional }, new { manufacturerId = @"\d+" }, new[] { "TinyCms.Web.Controllers" }); //news routes.MapLocalizedRoute("", "news/{newsItemId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectNewsItemById", SeName = UrlParameter.Optional }, new { newsItemId = @"\d+" }, new[] { "TinyCms.Web.Controllers" }); //blog routes.MapLocalizedRoute("", "blog/{blogPostId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectBlogPostById", SeName = UrlParameter.Optional }, new { blogPostId = @"\d+" }, new[] { "TinyCms.Web.Controllers" }); //topic routes.MapLocalizedRoute("", "t/{SystemName}", new { controller = "BackwardCompatibility2X", action = "RedirectTopicBySystemName" }, new[] { "TinyCms.Web.Controllers" }); //vendors routes.MapLocalizedRoute("", "vendor/{vendorId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectVendorById", SeName = UrlParameter.Optional }, new { vendorId = @"\d+" }, new[] { "TinyCms.Web.Controllers" }); }
public void ConfigureRoutes(RouteCollection routes) { var culture = StrixPlatform.DefaultCultureCode.ToLower(); routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.LowercaseUrls = true; routes.RouteExistingFiles = true; var adminRoute = RouteTable.Routes.MapLocalizedRoute( "Admin_default", "{language}/Admin/{controller}/{action}/{id}", new { language = culture, controller = WebConstants.ADMIN, action = MvcConstants.INDEX, id = UrlParameter.Optional }, new { controller = new AdminRouteConstraint() }); routes.RemoveAt(routes.Count - 1); routes.Insert(0, adminRoute); routes.MapLocalizedRoute( "NotFound", "{language}/NotFound/{url}", new { language = culture, controller = "Home", action = "NotFound", url = UrlParameter.Optional }); routes.MapLocalizedRoute( "Error", "{language}/Error", new { language = culture, controller = "Home", action = "Error" }); routes.MapLocalizedRoute( name: "Search", url: "{language}/Search/{action}/{options}", defaults: new { language = culture, controller = "Search", action = "Index", options = UrlParameter.Optional }); routes.MapLocalizedRoute( name: "Default", url: "{language}/{controller}/{action}/{id}", defaults: new { language = culture, controller = "Home", action = "Index", id = UrlParameter.Optional }); }
public void RegisterRoutes(RouteCollection routes) { //generic URLs routes.MapGenericPathRoute("GenericUrl", "{*generic_se_name}", new { controller = "Common", action = "GenericUrl" }, new[] { "Seo.Route.Controllers" }); // Routes solely needed for URL creation, NOT for route matching. routes.MapLocalizedRoute("EngineerSeo1", "{SeName}", new { controller = "Engineers", action = "EngineerDetails" }, new[] { "Seo.Route.Controllers" }); routes.MapLocalizedRoute("EngineerSeo2", "{SeCountry}", new { controller = "Engineers", action = "EngineerDetails" }, new[] { "Seo.Route.Controllers" }); routes.MapLocalizedRoute("EngineerSeo3", "{SeMobile}", new { controller = "Engineers", action = "EngineerDetails" }, new[] { "Seo.Route.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { //Home page routes.MapLocalizedRoute("HomePage", "", new { controller = "Home", action = "Index" }, new[] { "RANSUROTTO.BLOG.Web.Controllers" }); //Login page routes.MapLocalizedRoute("Login", "login/", new { controller = "Customer", action = "Login" }, new[] { "RANSUROTTO.BLOG.Web.Controllers" }); //Register page routes.MapLocalizedRoute("Register", "register/", new { controller = "Customer", action = "Register" }, new[] { "RANSUROTTO.BLOG.Web.Controllers" }); //Lsogout page routes.MapLocalizedRoute("Logout", "logout/", new { controller = "Customer", action = "Logout" }, new[] { "RANSUROTTO.BLOG.Web.Controllers" }); //Install page routes.MapRoute("Installation", "install", new { controller = "Install", action = "Index" }, new[] { "RANSUROTTO.BLOG.Web.Controllers" }); //Page not found page routes.MapLocalizedRoute("PageNotFound", "page-not-found", new { controller = "Common", action = "PageNotFound" }, new[] { "RANSUROTTO.BLOG.Web.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { routes.MapRoute("Plugin.Misc.Vendor.Test", "test/test", new { controller = "Test", action = "Test" }, new[] { "Nop.Plugin.Misc.Vendor.Controllers" } ); routes.MapLocalizedRoute("Register2", "Catalog/CategoryNavigation", new { controller = "Catalog", action = "Test" }, new[] { "Nop.Plugin.Misc.Vendor.Controllers" } ); }
public void RegisterRoutes(RouteCollection routes) { //home page routes.MapLocalizedRoute("HomePage", "", new { controller = "Home", action = "Index" }, new[] { "UHack.Web.Controllers" }); #region Common Controller routes.MapLocalizedRoute("ErrorPage", "page-error", new { controller = "Common", action = "ErrorPage" }, new[] { "UHack.Web.Controllers" }); routes.MapLocalizedRoute("AsyncUpload", "async-upload", new { controller = "Common", action = "AsyncUpload" }, new[] { "UHack.Web.Controllers" }); routes.MapLocalizedRoute("AsyncUpload_", "async-upload_", new { controller = "Common", action = "AsyncUpload_" }, new[] { "UHack.Web.Controllers" }); routes.MapLocalizedRoute("PageNotFound", "page-not-found", new { controller = "Common", action = "PageNotFound" }, new[] { "UHack.Web.Controllers" }); routes.MapLocalizedRoute("ClearCache", "cache-clear", new { controller = "Common", action = "ClearCache" }, new[] { "UHack.Web.Controllers" }); routes.MapLocalizedRoute("ClearCacheByKey", "cache-clear-key", new { controller = "Common", action = "ClearCacheByKey" }, new[] { "UHack.Web.Controllers" }); routes.MapLocalizedRoute("RestartApplication", "application-restart", new { controller = "Common", action = "RestartApplication" }, new[] { "UHack.Web.Controllers" }); routes.MapLocalizedRoute("KeepAlive", "keep-alive", new { controller = "KeepAlive", action = "Index" }, new[] { "UHack.Web.Controllers" }); #endregion }
public void RegisterRoutes(RouteCollection routes) { var config = EngineContext.Current.Resolve <YStoryConfig>(); if (!config.SupportPreviousYourstoryVersions) { return; } //articles routes.MapLocalizedRoute("", "p/{articleId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectArticleById", SeName = UrlParameter.Optional }, new { articleId = @"\d+" }, new[] { "YStory.Web.Controllers" }); //categories routes.MapLocalizedRoute("", "c/{categoryId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectCategoryById", SeName = UrlParameter.Optional }, new { categoryId = @"\d+" }, new[] { "YStory.Web.Controllers" }); //publishers routes.MapLocalizedRoute("", "m/{publisherId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectPublisherById", SeName = UrlParameter.Optional }, new { publisherId = @"\d+" }, new[] { "YStory.Web.Controllers" }); //news routes.MapLocalizedRoute("", "news/{newsItemId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectNewsItemById", SeName = UrlParameter.Optional }, new { newsItemId = @"\d+" }, new[] { "YStory.Web.Controllers" }); //blog routes.MapLocalizedRoute("", "blog/{blogPostId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectBlogPostById", SeName = UrlParameter.Optional }, new { blogPostId = @"\d+" }, new[] { "YStory.Web.Controllers" }); //topic routes.MapLocalizedRoute("", "t/{SystemName}", new { controller = "BackwardCompatibility2X", action = "RedirectTopicBySystemName" }, new[] { "YStory.Web.Controllers" }); //contributors routes.MapLocalizedRoute("", "contributor/{contributorId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectContributorById", SeName = UrlParameter.Optional }, new { contributorId = @"\d+" }, new[] { "YStory.Web.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { var config = EngineContext.Current.Resolve <NopConfig>(); if (!config.SupportPreviousNopcommerceVersions) { return; } //products routes.MapLocalizedRoute("", "p/{productId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectProductById", SeName = UrlParameter.Optional }, new { productId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //categories routes.MapLocalizedRoute("", "c/{categoryId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectCategoryById", SeName = UrlParameter.Optional }, new { categoryId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //destinations routes.MapLocalizedRoute("", "m/{destinationId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectDestinationById", SeName = UrlParameter.Optional }, new { destinationId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //news routes.MapLocalizedRoute("", "news/{newsItemId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectNewsItemById", SeName = UrlParameter.Optional }, new { newsItemId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //blog routes.MapLocalizedRoute("", "blog/{blogPostId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectBlogPostById", SeName = UrlParameter.Optional }, new { blogPostId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //topic routes.MapLocalizedRoute("", "t/{SystemName}", new { controller = "BackwardCompatibility2X", action = "RedirectTopicBySystemName" }, new[] { "Nop.Web.Controllers" }); //vendors routes.MapLocalizedRoute("", "vendor/{vendorId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectVendorById", SeName = UrlParameter.Optional }, new { vendorId = @"\d+" }, new[] { "Nop.Web.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { // đăng ký mẫu url khái quát dùng để phân giải Url đến với loại có 1 phân đoạn và đa ngôn ngữ. Route này được đặt sau tất cả // các route thông dụng, cho nên chỉ khi ko thể nào phân giải được ở các route trước đó, code mới chạy đến route này // việc phân giải url ở view sẽ ko đi vào route này, vì route đòi hỏi 1 phân đoạn tên rất đặc biệt: "generic_se_name", // sẽ ko có 1 yêu cầu nào ở view dùng tên phân đoạn "kỳ lạ" như thế này routes.MapGenericPathRoute("GenericUrl", "{generic_se_name}", new { controller = "Common", action = "GenericUrl" }, new[] { "Research.Web.Controllers" }); // các route này chỉ dùng để tạo link trong các view chứ ko hề có ý nghĩa trong phân giải url đến. Tất cả các url đến // loại 1 phân đoạn nếu có thể đều sẽ đi vào GenericPathRoute ở phía trên routes.MapLocalizedRoute("Product", "{SeName}", new { controller = "Product", action = "ProductDetails" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("Category", "{SeName}", new { controller = "Catalog", action = "Category" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("Manufacturer", "{SeName}", new { controller = "Catalog", action = "Manufacturer" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("Vendor", "{SeName}", new { controller = "Catalog", action = "Vendor" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("NewsItem", "{SeName}", new { controller = "News", action = "NewsItem" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("BlogPost", "{SeName}", new { controller = "Blog", action = "BlogPost" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("Topic", "{SeName}", new { controller = "Topic", action = "TopicDetails" }, new[] { "Research.Web.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { var supportPreviousNopcommerceVersions = !String.IsNullOrEmpty(ConfigurationManager.AppSettings["SupportPreviousNopcommerceVersions"]) && Convert.ToBoolean(ConfigurationManager.AppSettings["SupportPreviousNopcommerceVersions"]); if (!supportPreviousNopcommerceVersions) return; //products routes.MapLocalizedRoute("", "p/{productId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectProductById", SeName = UrlParameter.Optional }, new { productId = @"\d+" }, new[] { "TinyCms.Web.Controllers" }); //categories routes.MapLocalizedRoute("", "c/{categoryId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectCategoryById", SeName = UrlParameter.Optional }, new { categoryId = @"\d+" }, new[] { "TinyCms.Web.Controllers" }); //manufacturers routes.MapLocalizedRoute("", "m/{manufacturerId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectManufacturerById", SeName = UrlParameter.Optional }, new { manufacturerId = @"\d+" }, new[] { "TinyCms.Web.Controllers" }); //news routes.MapLocalizedRoute("", "news/{newsItemId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectNewsItemById", SeName = UrlParameter.Optional }, new { newsItemId = @"\d+" }, new[] { "TinyCms.Web.Controllers" }); //blog routes.MapLocalizedRoute("", "blog/{blogPostId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectBlogPostById", SeName = UrlParameter.Optional }, new { blogPostId = @"\d+" }, new[] { "TinyCms.Web.Controllers" }); //topic routes.MapLocalizedRoute("", "t/{SystemName}", new { controller = "BackwardCompatibility2X", action = "RedirectTopicBySystemName" }, new[] { "TinyCms.Web.Controllers" }); //vendors routes.MapLocalizedRoute("", "vendor/{vendorId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectVendorById", SeName = UrlParameter.Optional }, new { vendorId = @"\d+" }, new[] { "TinyCms.Web.Controllers" }); }
public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); //routes.MapRoute( // name: "Default", // url: "{controller}/{action}/{id}", // defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } //); routes.MapLocalizedRoute( defaultCulture: "en-US", name: "Default_Culturized", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); }
public void RegisterRoutes(RouteCollection routes) { routes.MapLocalizedRoute( "Default_Localized", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional }, new { controller = new IsKnownController() }, new[] { "SmartStore.Web.Controllers" } ); routes.MapRoute( "Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional }, new { controller = new IsKnownController() }, new[] { "SmartStore.Web.Controllers" } ); }
public void RegisterRoutes(RouteCollection routes) { var config = EngineContext.Current.Resolve<NopConfig>(); if (!config.SupportPreviousNopcommerceVersions) return; //products routes.MapLocalizedRoute("", "p/{productId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectProductById", SeName = UrlParameter.Optional }, new { productId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //categories routes.MapLocalizedRoute("", "c/{categoryId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectCategoryById", SeName = UrlParameter.Optional }, new { categoryId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //manufacturers routes.MapLocalizedRoute("", "m/{manufacturerId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectManufacturerById", SeName = UrlParameter.Optional }, new { manufacturerId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //news routes.MapLocalizedRoute("", "news/{newsItemId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectNewsItemById", SeName = UrlParameter.Optional }, new { newsItemId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //blog routes.MapLocalizedRoute("", "blog/{blogPostId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectBlogPostById", SeName = UrlParameter.Optional }, new { blogPostId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //topic routes.MapLocalizedRoute("", "t/{SystemName}", new { controller = "BackwardCompatibility2X", action = "RedirectTopicBySystemName" }, new[] { "Nop.Web.Controllers" }); //vendors routes.MapLocalizedRoute("", "vendor/{vendorId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectVendorById", SeName = UrlParameter.Optional }, new { vendorId = @"\d+" }, new[] { "Nop.Web.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { // Generic URLs routes.MapGenericPathRoute("GenericUrl", "{*generic_se_name}", new { controller = "Common", action = "GenericUrl" }, new[] { "SmartStore.Web.Controllers" }); // Routes solely needed for URL creation, NOT for route matching. routes.MapLocalizedRoute("Product", "{SeName}", new { controller = "Product", action = "Product" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("Category", "{SeName}", new { controller = "Catalog", action = "Category" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("Manufacturer", "{SeName}", new { controller = "Catalog", action = "Manufacturer" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("Topic", "{SeName}", new { controller = "Topic", action = "TopicDetails" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("NewsItem", "{SeName}", new { controller = "News", action = "NewsItem" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("BlogPost", "{SeName}", new { controller = "Blog", action = "BlogPost" }, new[] { "SmartStore.Web.Controllers" }); // TODO: actually this one's never reached, because the "GenericUrl" route // at the top handles this. routes.MapLocalizedRoute("PageNotFound", "{*path}", new { controller = "Error", action = "NotFound" }, new[] { "SmartStore.Web.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { var idConstraint = new MinRouteConstraint(1); var route = routes.MapRoute( "Admin_default", "Admin/{controller}/{action}/{id}", new { controller = "Home", action = "Index", area = "Admin", id = "" }, new[] { "CAF.WebSite.Mvc.Admin.Controllers" } ); route.DataTokens["area"] = "Admin"; var routeCategory = routes.MapLocalizedRoute("CustomerProfile", "Admin/Category/{id}", new { controller = "Category", action = "Index", area = "Admin" }, new { id = idConstraint }, new[] { "CAF.WebSite.Mvc.Admin.Controllers" } ); routeCategory.DataTokens["area"] = "Admin"; }
public void RegisterRoutes(RouteCollection routes) { // routes.Add( // "@DomainRoute", new DomainRoute( // "myhost.com", // "{controller}/{action}/{id}", // new { controller = "Home", action = "Index", id = UrlParameter.Optional } //)); // routes.Add( // "wwwDomainRoute", new DomainRoute( // "www.myhost.com", // "{controller}/{action}/{id}", // new { controller = "Home", action = "Index", id = UrlParameter.Optional } // )); routes.MapLocalizedRoute( "Default_Localized", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional }, new { controller = new IsKnownController() }, new[] { "CAF.WebSite.Mvc.Controllers" } ); routes.MapRoute( "Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional }, new { controller = new IsKnownController() }, new[] { "CAF.WebSite.Mvc.Controllers" } ); //routes.Add( // "DomainRoute", new DomainRoute( // "{CityNameUrl}.myhost.com", // "{controller}/{action}/{id}", // new { CityNameUrl = "", controller = "Domain", action = "Index", id = "" } // )); }
public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); //routes.MapRoute( // name: "Default", // url: "{controller}/{action}/{Id}", // //url: "{controller}/{action}/{Id}", // defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }, // namespaces: new string[] { "ArquivoSilvaMagalhaes.Controllers" }//, // //constraints: new { lang = "[a-zA-Z]{2}(-[a-zA-Z])?"} //); routes.MapLocalizedRoute("Default", url: "{culture}/{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }, constraints: new { culture = "[a-zA-Z]{2}(-[a-zA-Z]{2})?" }, namespaces: new string[] { "ArquivoSilvaMagalhaes.Controllers" }); routes.MapRouteToLocalizeRedirect("RedirectToLocalize", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }); }
public void RegisterRoutes(RouteCollection routes) { //generic URLs routes.MapGenericPathRoute("GenericUrl", "{*generic_se_name}", new { controller = "Common", action = "GenericUrl" }, new[] { "SmartStore.Web.Controllers" }); // Routes solely needed for URL creation, NOT for route matching. routes.MapLocalizedRoute("Product", "{SeName}", new { controller = "Product", action = "Product" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("Category", "{SeName}", new { controller = "Catalog", action = "Category" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("Manufacturer", "{SeName}", new { controller = "Catalog", action = "Manufacturer" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("NewsItem", "{SeName}", new { controller = "News", action = "NewsItem" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("BlogPost", "{SeName}", new { controller = "Blog", action = "BlogPost" }, new[] { "SmartStore.Web.Controllers" }); // TODO: actually this one's never reached, because the "GenericUrl" route // at the top handles this. routes.MapLocalizedRoute("PageNotFound", "{*path}", new { controller = "Error", action = "NotFound" }, new[] { "SmartStore.Web.Controllers" }); }
public static void RegisterRoutes(RouteCollection routes) { // routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); //home page routes.MapRoute("HomePage", "", new { controller = "Home", action = "GutterCleanRequest" }, new[] { "EGSW.Web.Controllers" }); //GutterCleanRequest routes.MapRoute("GutterCleanRequest", "gutter-clean-request/", new { controller = "Home", action = "GutterCleanRequest" }, new[] { "EGSW.Web.Controllers" }); //GutterCleanRequest routes.MapRoute("GutterCleanInfoRegister", "gutter-clean-info/", new { controller = "Home", action = "GutterCleanInfoRegister" }, new[] { "EGSW.Web.Controllers" }); //ContactUs routes.MapRoute("ContactUs", "contact-us/", new { controller = "Home", action = "Contact" }, new[] { "EGSW.Web.Controllers" }); //ReferANeighbor routes.MapRoute("ReferANeighbor", "refer-a-neighbor/", new { controller = "Common", action = "ReferANeighbor" }, new[] { "EGSW.Web.Controllers" }); //GenerateQuote routes.MapRoute("GenerateQuote", "generate-quote/", new { controller = "Home", action = "GenerateQuote" }, new[] { "EGSW.Web.Controllers" }); //Process Payment Completed routes.MapRoute("ProcessPayment", "process-payment/", new { controller = "Home", action = "ProcessPayment" }, new[] { "EGSW.Web.Controllers" }); // Completed routes.MapRoute("Completed", "completed/{orderId}", new { controller = "Home", action = "Completed" }, new { orderId = @"\d+" }, new[] { "EGSW.Web.Controllers" }); //login routes.MapRoute("Login", "login/", new { controller = "Account", action = "Login" }); //login routes.MapRoute("LogOff", "log-off/", new { controller = "Account", action = "LogOff" }); //Register routes.MapRoute("Register", "register/", new { controller = "Account", action = "Register" }); //CustomerInfo routes.MapRoute("CustomerInfo", "profile/", new { controller = "Account", action = "Info" }); //CustomerAddresses routes.MapRoute("CustomerAddresses", "addresses/", new { controller = "Account", action = "Addresses" }); routes.MapRoute("CustomerAddressDelete", "customer/addressdelete/{addressId}", new { controller = "Account", action = "AddressDelete" }, new { addressId = @"\d+" }); routes.MapRoute("CustomerAddressEdit", "customer/addressedit/{addressId}", new { controller = "Account", action = "AddressEdit" }, new { addressId = @"\d+" }); routes.MapRoute("CustomerAddressAdd", "customer/addressadd", new { controller = "Account", action = "AddressAdd" }); //CustomerOrders routes.MapRoute("CustomerOrders", "order/", new { controller = "Order", action = "Index" }); // Completed routes.MapRoute("OrderDetails", "order-details/{orderId}", new { controller = "Order", action = "OrderDetail" }, new { orderId = @"\d+" }, new[] { "EGSW.Web.Controllers" }); //CustomerChangePassword routes.MapRoute("CustomerChangePassword", "changepassword/", new { controller = "Account", action = "ChangePassword" }); //passwordrecovery routes.MapRoute("PasswordRecovery", "passwordrecovery/", new { controller = "Account", action = "ForgotPassword" }, new[] { "EGSW.Web.Controllers" }); //Reset Password routes.MapRoute("ResetPassword", "resetpassword/", new { controller = "Account", action = "ResetPassword" }, new[] { "EGSW.Web.Controllers" }); //GenerateQuote routes.MapRoute("Survey", "survey/{surveykey}", new { controller = "Order", action = "Survey" }, new[] { "EGSW.Web.Controllers" }); routes.MapRoute("SurveyConfirmation", "survey-confirmation", new { controller = "Order", action = "SurveyConfirmation" }, new[] { "EGSW.Web.Controllers" }); //Comming Soon routes.MapRoute("AboutUs", "about-us/", new { controller = "Static", action = "AboutUs" }); //Comming Soon routes.MapRoute("TermsAndCondition", "Term-and-Condition/", new { controller = "Static", action = "termsAndCondition" }); //Comming Soon routes.MapRoute("CityNames", "citynames/", new { controller = "Common", action = "CityNames" }); //Comming Soon routes.MapRoute("FAQ", "faq/", new { controller = "Static", action = "Faq" }); //Comming Soon routes.MapRoute("CommingSoon", "comming-soon/", new { controller = "Static", action = "Index" }); //sitemap (XML) routes.MapRoute("sitemap.xml", "sitemap.xml", new { controller = "Common", action = "SeoSitemapXml" }); routes.MapLocalizedRoute("SeoFriendlyUrl", "{SeoFriendlyName}", new { controller = "Common", action = "Index" }, new[] { "EGSW.Web.Controllers" }); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } , namespaces: new[] { "EGSW.Web.Controllers" } ); }
public void RegisterRoutes(RouteCollection routes) { //home page routes.MapLocalizedRoute(SystemRouteNames.HomePage, "", new { controller = "Home", action = "Index"}, new[] { "eCentral.Web.Controllers" }); #region Routes per Controller routes.MapRoute( "Configuration", // Route name "configuration/{controller}/{action}/{rowId}", // Route Pattern new { controller = "Home", action = "Index", rowId = UrlParameter.Optional }, // Default values for parameters new { controller = @"(EmailAccount|MessageTemplate|Setting|Country)" }); //Restriction for controller and action routes.MapRoute( "Administration", // Route name "administration/{controller}/{action}/{rowId}", // Route Pattern new { controller = "Home", action = "Index", rowId = UrlParameter.Optional }, // Default values for parameters new { controller = @"(Company|BranchOffice|Client|User)" }); //Restriction for controller and action routes.MapRoute( "System", // Route name "system-maintenance/{controller}/{action}/{rowId}", // Route Pattern new { controller = @"(System|Log)", action = "Index", rowId = UrlParameter.Optional }); //Restriction for controller and action routes.MapRoute( "AuditHistory", // Route name "audit-history/{action}/{rowId}", // Route Pattern new { controller = "AuditHistory", action = "Index", rowId = UrlParameter.Optional }); //Restriction for controller and action #endregion //login routes.MapLocalizedRoute(SystemRouteNames.Login, SystemRouteUrls.Login, new { controller = "Security", action = "Login" }, new[] { "eCentral.Web.Controllers" }); routes.MapLocalizedRoute(SystemRouteNames.Logout, SystemRouteUrls.Logout, new { controller = "Security", action = "Logout" }, new[] { "eCentral.Web.Controllers" }); routes.MapLocalizedRoute(SystemRouteNames.AccountActivation, SystemRouteUrls.AccountActivation, new { controller = "Security", action = "AccountActivation" }, new { userId = new GuidConstraint(false), token = new GuidConstraint(false) }, new[] { "eCentral.Web.Controllers" }); routes.MapLocalizedRoute(SystemRouteNames.PasswordRecovery, SystemRouteUrls.PasswordRecovery, new { controller = "Security", action = "PasswordRecovery" }, new[] { "eCentral.Web.Controllers" }); routes.MapLocalizedRoute(SystemRouteNames.PasswordRecoveryConfirm, SystemRouteUrls.PasswordRecoveryConfirm, new { controller = "Security", action = "PasswordRecoveryConfirm" }, new { userId = new GuidConstraint(false), token = new GuidConstraint(false) }, new[] { "eCentral.Web.Controllers" }); routes.MapLocalizedRoute(SystemRouteNames.ChangePassword, SystemRouteUrls.ChangePassword, new { controller = "Security", action = "ChangePassword" }, new[] { "eCentral.Web.Controllers" }); //upload image routes.MapRoute(SystemRouteNames.AsyncUpload, SystemRouteUrls.AsyncUpload, new {controller = "Media", action = "AsyncUpload"}, new[] { "eCentral.Web.Controllers" }); routes.MapRoute(SystemRouteNames.Search, SystemRouteUrls.Search, new { controller = "Search", action = "Index" }, new[] { "eCentral.Web.Controllers" }); //static pages - error, 404 and site clsoed routes.MapRoute(SystemRouteNames.SiteClosed, SystemRouteUrls.SiteClosed, new { controller = "Static", action = "SiteClosed" }, new[] { "eCentral.Web.Controllers" }); routes.MapRoute(SystemRouteNames.PageNotFound, SystemRouteUrls.PageNotFound, new { controller = "Static", action = "PageNotFound" }, new[] { "eCentral.Web.Controllers" }); routes.MapRoute(SystemRouteNames.Error, SystemRouteUrls.Error, new { controller = "Static", action = "Error" }, new[] { "eCentral.Web.Controllers" }); routes.MapRoute(SystemRouteNames.AccessDenied, SystemRouteUrls.AccessDenied, new { controller = "Static", action = "AccessDenied" }, new[] { "eCentral.Web.Controllers" }); routes.MapRoute( "Default", // Route name "{controller}/{action}/{rowId}", // URL with parameters new { controller = "Home", action = "Index", area = "", rowId = UrlParameter.Optional }, new { controller = @"(Common|Widget|API)" }); //Restriction for controller and action }
public void RegisterRoutes(RouteCollection routes) { //home page routes.MapLocalizedRoute("HomePage", "", new { controller = "Home", action = "Index"}, new[] { "Nop.Web.Controllers" }); //install routes.MapRoute("Installation", "install", new { controller = "Install", action = "Index" }, new[] { "Nop.Web.Controllers" }); //products routes.MapLocalizedRoute("RecentlyViewedProducts", "recentlyviewedproducts/", new { controller = "Catalog", action = "RecentlyViewedProducts" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("RecentlyAddedProducts", "newproducts/", new { controller = "Catalog", action = "RecentlyAddedProducts" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("RecentlyAddedProductsRSS", "newproducts/rss", new { controller = "Catalog", action = "RecentlyAddedProductsRss" }, new[] { "Nop.Web.Controllers" }); //comparing products routes.MapLocalizedRoute("AddProductToCompare", "compareproducts/add/{productId}", new { controller = "Catalog", action = "AddProductToCompareList" }, new { productId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CompareProducts", "compareproducts/", new { controller = "Catalog", action = "CompareProducts" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("RemoveProductFromCompareList", "compareproducts/remove/{productId}", new { controller = "Catalog", action = "RemoveProductFromCompareList"}, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ClearCompareList", "clearcomparelist/", new { controller = "Catalog", action = "ClearCompareList" }, new[] { "Nop.Web.Controllers" }); //product email a friend routes.MapLocalizedRoute("ProductEmailAFriend", "productemailafriend/{productId}", new { controller = "Catalog", action = "ProductEmailAFriend" }, new { productId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //catalog routes.MapLocalizedRoute("ManufacturerList", "manufacturer/all/", new { controller = "Catalog", action = "ManufacturerAll" }, new[] { "Nop.Web.Controllers" }); //downloads routes.MapRoute("GetSampleDownload", "download/sample/{productvariantid}", new { controller = "Download", action = "Sample"}, new { productvariantid = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapRoute("GetDownload", "download/getdownload/{opvid}/{agree}", new { controller = "Download", action = "GetDownload", agree = UrlParameter.Optional }, new { opvid = new GuidConstraint(false) }, new[] { "Nop.Web.Controllers" }); routes.MapRoute("GetLicense", "download/getlicense/{opvid}/", new { controller = "Download", action = "GetLicense" }, new { opvid = new GuidConstraint(false) }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("DownloadUserAgreement", "customer/useragreement/{opvid}", new { controller = "Customer", action = "UserAgreement" }, new { opvid = new GuidConstraint(false) }, new[] { "Nop.Web.Controllers" }); //reviews routes.MapLocalizedRoute("ProductReviews", "productreviews/{productId}", new { controller = "Catalog", action = "ProductReviews" }, new[] { "Nop.Web.Controllers" }); routes.MapRoute("SetProductReviewHelpfulness", "setproductreviewhelpfulness", new { controller = "Catalog", action = "SetProductReviewHelpfulness" }, new[] { "Nop.Web.Controllers" }); //back in stock notifications routes.MapLocalizedRoute("BackInStockSubscribePopup", "backinstocksubscribe/{productVariantId}", new { controller = "Catalog", action = "BackInStockSubscribePopup" }, new { productVariantId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("DeleteBackInStockSubscription", "backinstocksubscribe/delete/{subscriptionId}", new { controller = "Customer", action = "DeleteBackInStockSubscription" }, new { subscriptionId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //login, register routes.MapLocalizedRoute("Login", "login/", new { controller = "Customer", action = "Login" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("LoginCheckoutAsGuest", "login/checkoutasguest", new { controller = "Customer", action = "Login", checkoutAsGuest = true }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("Register", "register/", new { controller = "Customer", action = "Register" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("Logout", "logout/", new { controller = "Customer", action = "Logout" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("RegisterResult", "registerresult/{resultId}", new { controller = "Customer", action = "RegisterResult" }, new { resultId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckUsernameAvailability", "customer/checkusernameavailability", new { controller = "Customer", action = "CheckUsernameAvailability" }, new[] { "Nop.Web.Controllers" }); //shopping cart routes.MapLocalizedRoute("ShoppingCart", "cart/", new { controller = "ShoppingCart", action = "Cart" }, new[] { "Nop.Web.Controllers" }); //wishlist routes.MapLocalizedRoute("Wishlist", "wishlist/{customerGuid}", new { controller = "ShoppingCart", action = "Wishlist", customerGuid = UrlParameter.Optional }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("EmailWishlist", "emailwishlist", new { controller = "ShoppingCart", action = "EmailWishlist" }, new[] { "Nop.Web.Controllers" }); //add product to cart (without any attributes and options) routes.MapLocalizedRoute("AddProductToCart", "addproducttocart/{productId}/{shoppingCartTypeId}/{quantity}", new { controller = "ShoppingCart", action = "AddProductToCart" }, new { productId = @"\d+", shoppingCartTypeId = @"\d+", quantity = @"\d+" }, new[] { "Nop.Web.Controllers" }); //add product variant to cart (with attributes and options) routes.MapLocalizedRoute("AddProductVariantToCart", "addproductvarianttocart/{productVariantId}/{shoppingCartTypeId}", new { controller = "ShoppingCart", action = "AddProductVariantToCart" }, new { productVariantId = @"\d+", shoppingCartTypeId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //product attributes with "upload file" type routes.MapLocalizedRoute("UploadFileProductAttribute", "uploadfileproductattribute/{productVariantId}/{productAttributeId}", new { controller = "ShoppingCart", action = "UploadFileProductAttribute" }, new { productVariantId = @"\d+", productAttributeId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //checkout routes.MapLocalizedRoute("Checkout", "checkout/", new { controller = "Checkout", action = "Index" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutOnePage", "onepagecheckout/", new { controller = "Checkout", action = "OnePageCheckout" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutShippingAddress", "checkout/shippingaddress", new { controller = "Checkout", action = "ShippingAddress" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutSelectShippingAddress", "checkout/selectshippingaddress", new { controller = "Checkout", action = "SelectShippingAddress" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutBillingAddress", "checkout/billingaddress", new { controller = "Checkout", action = "BillingAddress" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutSelectBillingAddress", "checkout/selectbillingaddress", new { controller = "Checkout", action = "SelectBillingAddress" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutShippingMethod", "checkout/shippingmethod", new { controller = "Checkout", action = "ShippingMethod" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutPaymentMethod", "checkout/paymentmethod", new { controller = "Checkout", action = "PaymentMethod" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutPaymentInfo", "checkout/paymentinfo", new { controller = "Checkout", action = "PaymentInfo" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutConfirm", "checkout/confirm", new { controller = "Checkout", action = "Confirm" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutCompleted", "checkout/completed/{orderId}", new { controller = "Checkout", action = "Completed", orderId = UrlParameter.Optional }, new { orderId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //orders routes.MapLocalizedRoute("OrderDetails", "orderdetails/{orderId}", new { controller = "Order", action = "Details" }, new { orderId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ShipmentDetails", "orderdetails/shipment/{shipmentId}", new { controller = "Order", action = "ShipmentDetails" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ReturnRequest", "returnrequest/{orderId}", new { controller = "ReturnRequest", action = "ReturnRequest" }, new { orderId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ReOrder", "reorder/{orderId}", new { controller = "Order", action = "ReOrder" }, new { orderId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("GetOrderPdfInvoice", "orderdetails/pdf/{orderId}", new { controller = "Order", action = "GetPdfInvoice" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PrintOrderDetails", "orderdetails/print/{orderId}", new { controller = "Order", action = "PrintOrderDetails" }, new[] { "Nop.Web.Controllers" }); //contact us routes.MapLocalizedRoute("ContactUs", "contactus", new { controller = "Common", action = "ContactUs" }, new[] { "Nop.Web.Controllers" }); //store closed routes.MapLocalizedRoute("StoreClosed", "storeclosed", new { controller = "Common", action = "StoreClosed" }, new[] { "Nop.Web.Controllers" }); //passwordrecovery routes.MapLocalizedRoute("PasswordRecovery", "passwordrecovery", new { controller = "Customer", action = "PasswordRecovery" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PasswordRecoveryConfirm", "passwordrecovery/confirm", new { controller = "Customer", action = "PasswordRecoveryConfirm" }, new[] { "Nop.Web.Controllers" }); //newsletters routes.MapLocalizedRoute("NewsletterActivation", "newsletter/subscriptionactivation/{token}/{active}", new { controller = "Newsletter", action = "SubscriptionActivation" }, new { token = new GuidConstraint(false) }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("SubscribeNewsletter", "subscribenewsletter", new { controller = "Newsletter", action = "SubscribeNewsletter" }, new[] { "Nop.Web.Controllers" }); //customer routes.MapLocalizedRoute("CustomerMyAccount", "customer/myaccount", new { controller = "Customer", action = "MyAccount" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerInfo", "customer/info", new { controller = "Customer", action = "Info" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerAddresses", "customer/addresses", new { controller = "Customer", action = "Addresses" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerOrders", "customer/orders", new { controller = "Customer", action = "Orders" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerReturnRequests", "customer/returnrequests", new { controller = "Customer", action = "ReturnRequests" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerDownloadableProducts", "customer/downloadableproducts", new { controller = "Customer", action = "DownloadableProducts" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerBackInStockSubscriptions", "customer/backinstocksubscriptions", new { controller = "Customer", action = "BackInStockSubscriptions" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerBackInStockSubscriptionsPaged", "customer/backinstocksubscriptions/{page}", new { controller = "Customer", action = "BackInStockSubscriptions", page = UrlParameter.Optional }, new { page = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerRewardPoints", "customer/rewardpoints", new { controller = "Customer", action = "RewardPoints" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerChangePassword", "customer/changepassword", new { controller = "Customer", action = "ChangePassword" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerAvatar", "customer/avatar", new { controller = "Customer", action = "Avatar" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("AccountActivation", "customer/activation", new { controller = "Customer", action = "AccountActivation" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerProfile", "profile/{id}", new { controller = "Profile", action = "Index" }, new { id = @"\d+"}, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerProfilePaged", "profile/{id}/page/{page}", new { controller = "Profile", action = "Index"}, new { id = @"\d+", page = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerForumSubscriptions", "customer/forumsubscriptions", new { controller = "Customer", action = "ForumSubscriptions"}, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerForumSubscriptionsPaged", "customer/forumsubscriptions/{page}", new { controller = "Customer", action = "ForumSubscriptions", page = UrlParameter.Optional }, new { page = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("DeleteForumSubscription", "customer/forumsubscriptions/delete/{subscriptionId}", new { controller = "Customer", action = "DeleteForumSubscription" }, new { subscriptionId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //addresses routes.MapLocalizedRoute("CustomerAddressDelete", "customer/addressdelete/{addressId}", new { controller = "Customer", action = "AddressDelete" }, new { addressId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerAddressEdit", "customer/addressedit/{addressId}", new { controller = "Customer", action = "AddressEdit" }, new { addressId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerAddressAdd", "customer/addressadd", new { controller = "Customer", action = "AddressAdd" }, new[] { "Nop.Web.Controllers" }); //blog routes.MapLocalizedRoute("Blog", "blog", new { controller = "Blog", action = "List" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("BlogByTag", "blog/tag/{tag}", new { controller = "Blog", action = "BlogByTag" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("BlogByMonth", "blog/month/{month}", new { controller = "Blog", action = "BlogByMonth" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("BlogRSS", "blog/rss/{languageId}", new { controller = "Blog", action = "ListRss" }, new { languageId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //forum routes.MapLocalizedRoute("Boards", "boards", new { controller = "Boards", action = "Index" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ActiveDiscussions", "boards/activediscussions", new { controller = "Boards", action = "ActiveDiscussions" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ActiveDiscussionsRSS", "boards/activediscussionsrss", new { controller = "Boards", action = "ActiveDiscussionsRSS" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PostEdit", "boards/postedit/{id}", new { controller = "Boards", action = "PostEdit" }, new { id = @"\d+"}, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PostDelete", "boards/postdelete/{id}", new { controller = "Boards", action = "PostDelete" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PostCreate", "boards/postcreate/{id}", new { controller = "Boards", action = "PostCreate"}, new { id = @"\d+"}, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PostCreateQuote", "boards/postcreate/{id}/{quote}", new { controller = "Boards", action = "PostCreate"}, new { id = @"\d+", quote = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicEdit", "boards/topicedit/{id}", new { controller = "Boards", action = "TopicEdit"}, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicDelete", "boards/topicdelete/{id}", new { controller = "Boards", action = "TopicDelete"}, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicCreate", "boards/topiccreate/{id}", new { controller = "Boards", action = "TopicCreate" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicMove", "boards/topicmove/{id}", new { controller = "Boards", action = "TopicMove" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicWatch", "boards/topicwatch/{id}", new { controller = "Boards", action = "TopicWatch" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicSlug", "boards/topic/{id}/{slug}", new { controller = "Boards", action = "Topic", slug = UrlParameter.Optional }, new { id = @"\d+"}, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicSlugPaged", "boards/topic/{id}/{slug}/page/{page}", new { controller = "Boards", action = "Topic", slug = UrlParameter.Optional, page = UrlParameter.Optional }, new { id = @"\d+", page = @"\d+"}, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ForumWatch", "boards/forumwatch/{id}", new { controller = "Boards", action = "ForumWatch" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ForumRSS", "boards/forumrss/{id}", new { controller = "Boards", action = "ForumRSS" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ForumSlug", "boards/forum/{id}/{slug}", new { controller = "Boards", action = "Forum", slug = UrlParameter.Optional }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ForumSlugPaged", "boards/forum/{id}/{slug}/page/{page}", new { controller = "Boards", action = "Forum", slug = UrlParameter.Optional, page = UrlParameter.Optional }, new { id = @"\d+", page = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ForumGroupSlug", "boards/forumgroup/{id}/{slug}", new { controller = "Boards", action = "ForumGroup", slug = UrlParameter.Optional }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("Search", "boards/search", new { controller = "Boards", action = "Search" }, new[] { "Nop.Web.Controllers" }); //private messages routes.MapLocalizedRoute("PrivateMessages", "privatemessages/{tab}", new { controller = "PrivateMessages", action = "Index", tab = UrlParameter.Optional }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PrivateMessagesPaged", "privatemessages/{tab}/page/{page}", new { controller = "PrivateMessages", action = "Index", tab = UrlParameter.Optional }, new { page = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PrivateMessagesInbox", "inboxupdate", new { controller = "PrivateMessages", action = "InboxUpdate" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PrivateMessagesSent", "sentupdate", new { controller = "PrivateMessages", action = "SentUpdate" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("SendPM", "sendpm/{toCustomerId}", new { controller = "PrivateMessages", action = "SendPM" }, new { toCustomerId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("SendPMReply", "sendpm/{toCustomerId}/{replyToMessageId}", new { controller = "PrivateMessages", action = "SendPM" }, new { toCustomerId = @"\d+", replyToMessageId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ViewPM", "viewpm/{privateMessageId}", new { controller = "PrivateMessages", action = "ViewPM" }, new { privateMessageId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("DeletePM", "deletepm/{privateMessageId}", new { controller = "PrivateMessages", action = "DeletePM" }, new { privateMessageId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //news routes.MapLocalizedRoute("NewsArchive", "news", new { controller = "News", action = "List" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("NewsRSS", "news/rss/{languageId}", new { controller = "News", action = "ListRss" }, new { languageId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //topics routes.MapLocalizedRoute("Topic", "t/{SystemName}", new { controller = "Topic", action = "TopicDetails" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicPopup", "t-popup/{SystemName}", new { controller = "Topic", action = "TopicDetailsPopup" }, new[] { "Nop.Web.Controllers" }); //sitemaps routes.MapLocalizedRoute("Sitemap", "sitemap", new { controller = "Common", action = "Sitemap" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("SitemapSEO", "sitemapseo", new { controller = "Common", action = "SitemapSeo" }, new[] { "Nop.Web.Controllers" }); //product tags routes.MapLocalizedRoute("ProductsByTag", "producttag/{productTagId}/{SeName}", new { controller = "Catalog", action = "ProductsByTag", SeName = UrlParameter.Optional }, new { productTagId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ProductTagsAll", "producttag/all/", new { controller = "Catalog", action = "ProductTagsAll" }, new[] { "Nop.Web.Controllers" }); #region Product tag URL fix //in versions 2.00-2.65 we had typo in producttag URLs ("productag" instead of "producttag") //we should support old "buggy" URLs routes.MapLocalizedRoute("ProductsByTag_Fix1", "productag/{productTagId}/{SeName}", new { controller = "BackwardCompatibility2X", action = "RedirectProductsByTag", SeName = UrlParameter.Optional }, new { productTagId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ProductTagsAll_Fix1", "productag/all/", new { controller = "BackwardCompatibility2X", action = "RedirectProductTagsAll" }, new[] { "Nop.Web.Controllers" }); #endregion //product search routes.MapLocalizedRoute("ProductSearch", "search/", new { controller = "Catalog", action = "Search" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ProductSearchAutoComplete", "catalog/searchtermautocomplete", new { controller = "Catalog", action = "SearchTermAutoComplete" }, new[] { "Nop.Web.Controllers" }); //config routes.MapLocalizedRoute("Config", "config", new { controller = "Common", action = "Config" }, new[] { "Nop.Web.Controllers" }); //some AJAX links routes.MapRoute("GetStatesByCountryId", "country/getstatesbycountryid/", new { controller = "Country", action = "GetStatesByCountryId" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ChangeDevice", "changedevice/{dontusemobileversion}", new { controller = "Common", action = "ChangeDevice" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ChangeCurrency", "changecurrency/{customercurrency}", new { controller = "Common", action = "CurrencySelected" }, new { customercurrency = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ChangeLanguage", "changelanguage/{langid}", new { controller = "Common", action = "SetLanguage" }, new { langid = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ChangeTaxType", "changetaxtype/{customertaxtype}", new { controller = "Common", action = "TaxTypeSelected" }, new { customertaxtype = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapRoute("EuCookieLawAccept", "eucookielawaccept", new { controller = "Common", action = "EuCookieLawAccept" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PollVote", "poll/vote", new { controller = "Poll", action = "Vote" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicAuthenticate", "topic/authenticate", new { controller = "Topic", action = "Authenticate" }, new[] { "Nop.Web.Controllers" }); //robots.txt routes.MapRoute("robots.txt", "robots.txt", new { controller = "Common", action = "RobotsTextFile" }, new[] { "Nop.Web.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { var idConstraint = new MinRouteConstraint(1); /* Common ----------------------------------------*/ routes.MapLocalizedRoute("HomePage", "", new { controller = "Home", action = "Index"}, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("Register", "register/", new { controller = "Customer", action = "Register" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("Login", "login/", new { controller = "Customer", action = "Login" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("Logout", "logout/", new { controller = "Customer", action = "Logout" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("ContactUs", "contactus", new { controller = "Home", action = "ContactUs" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("ShoppingCart", "cart/", new { controller = "ShoppingCart", action = "Cart" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("Wishlist", "wishlist/{customerGuid}", new { controller = "ShoppingCart", action = "Wishlist", customerGuid = UrlParameter.Optional }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("MyAccount", "customer/myaccount", new { controller = "Customer", action = "MyAccount" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("Topic", "t/{SystemName}", new { controller = "Topic", action = "TopicDetails" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("TopicPopup", "t-popup/{SystemName}", new { controller = "Topic", action = "TopicDetailsPopup" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("ProductSearch", "search/", new { controller = "Catalog", action = "Search" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("ProductSearchAutoComplete", "catalog/searchtermautocomplete", new { controller = "Catalog", action = "SearchTermAutoComplete" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("ChangeDevice", "changedevice/{dontusemobileversion}", new { controller = "Common", action = "ChangeDevice" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("ChangeCurrency", "changecurrency/{customercurrency}", new { controller = "Common", action = "CurrencySelected" }, new { customercurrency = idConstraint }, new[] { "SmartStore.Web.Controllers" }); routes.MapRoute("ChangeLanguage", "changelanguage/{langid}", new { controller = "Common", action = "SetLanguage" }, new { langid = idConstraint }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("ChangeTaxType", "changetaxtype/{customertaxtype}", new { controller = "Common", action = "TaxTypeSelected" }, new { customertaxtype = idConstraint }, new[] { "SmartStore.Web.Controllers" }); /* Catalog ----------------------------------------*/ routes.MapLocalizedRoute("ManufacturerList", "manufacturer/all/", new { controller = "Catalog", action = "ManufacturerAll" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("ProductsByTag", "producttag/{productTagId}/{SeName}", new { controller = "Catalog", action = "ProductsByTag", SeName = UrlParameter.Optional }, new { productTagId = idConstraint }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("ProductTagsAll", "producttag/all/", new { controller = "Catalog", action = "ProductTagsAll" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("RecentlyViewedProducts", "recentlyviewedproducts/", new { controller = "Catalog", action = "RecentlyViewedProducts" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("RecentlyAddedProducts", "newproducts/", new { controller = "Catalog", action = "RecentlyAddedProducts" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("RecentlyAddedProductsRSS", "newproducts/rss", new { controller = "Catalog", action = "RecentlyAddedProductsRss" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("CompareProducts", "compareproducts/", new { controller = "Catalog", action = "CompareProducts" }, new[] { "SmartStore.Web.Controllers" }); /* Shopping Cart ----------------------------------------*/ // add product to cart (without any attributes and options). used on catalog pages. routes.MapLocalizedRoute("AddProductToCartSimple", "cart/addproductsimple/{productId}", new { controller = "ShoppingCart", action = "AddProductSimple" }, new { productId = idConstraint }, new[] { "SmartStore.Web.Controllers" }); // add product to cart (with attributes and options). used on the product details pages. routes.MapLocalizedRoute("AddProductToCart", "cart/addproduct/{productId}/{shoppingCartTypeId}", new { controller = "ShoppingCart", action = "AddProduct" }, new { productId = idConstraint, shoppingCartTypeId = idConstraint }, new[] { "SmartStore.Web.Controllers" }); /* Checkout ----------------------------------------*/ routes.MapLocalizedRoute("Checkout", "checkout/", new { controller = "Checkout", action = "Index" }, new[] { "SmartStore.Web.Controllers" }); /* Newsletter ----------------------------------------*/ routes.MapLocalizedRoute("NewsletterActivation", "newsletter/subscriptionactivation/{token}/{active}", new { controller = "Newsletter", action = "SubscriptionActivation" }, new { token = new GuidConstraint(false) }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("SubscribeNewsletter", // COMPAT: subscribenewsletter >> newsletter/subscribe "Newsletter/Subscribe", new { controller = "Newsletter", action = "Subscribe" }, new[] { "SmartStore.Web.Controllers" }); /* Customer ----------------------------------------*/ routes.MapLocalizedRoute("AccountActivation", "customer/activation", new { controller = "Customer", action = "AccountActivation" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("CustomerProfile", "profile/{id}", new { controller = "Profile", action = "Index", id = UrlParameter.Optional }, new { id = idConstraint }, new[] { "SmartStore.Web.Controllers" }); /* Blog ----------------------------------------*/ routes.MapLocalizedRoute("Blog", "blog", new { controller = "Blog", action = "List" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("BlogByTag", "blog/tag/{tag}", new { controller = "Blog", action = "BlogByTag" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("BlogByMonth", "blog/month/{month}", new { controller = "Blog", action = "BlogByMonth" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("BlogRSS", "blog/rss/{languageId}", new { controller = "Blog", action = "ListRss" }, new { languageId = idConstraint }, new[] { "SmartStore.Web.Controllers" }); /* Boards ----------------------------------------*/ routes.MapLocalizedRoute("Boards", "boards", new { controller = "Boards", action = "Index" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("BoardPostCreate", "boards/postcreate/{id}/{quote}", new { controller = "Boards", action = "PostCreate", quote = UrlParameter.Optional }, new { id = idConstraint }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("TopicSlug", "boards/topic/{id}/{slug}", new { controller = "Boards", action = "Topic", slug = UrlParameter.Optional }, new { id = idConstraint }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("TopicSlugPaged", "boards/topic/{id}/{slug}/page/{page}", new { controller = "Boards", action = "Topic" }, new { id = idConstraint, page = idConstraint }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("ForumSlug", "boards/forum/{id}/{slug}", new { controller = "Boards", action = "Forum", slug = UrlParameter.Optional }, new { id = idConstraint }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("ForumSlugPaged", "boards/forum/{id}/{slug}/page/{page}", new { controller = "Boards", action = "Forum" }, new { id = idConstraint, page = idConstraint }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("ForumGroupSlug", "boards/forumgroup/{id}/{slug}", new { controller = "Boards", action = "ForumGroup", slug = UrlParameter.Optional }, new { id = idConstraint }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("BoardSearch", "boards/search", new { controller = "Boards", action = "Search" }, new[] { "SmartStore.Web.Controllers" }); /* Misc ----------------------------------------*/ routes.MapLocalizedRoute("RegisterResult", "registerresult/{resultId}", new { controller = "Customer", action = "RegisterResult" }, new { resultId = idConstraint }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("PrivateMessages", "privatemessages/{tab}", new { controller = "PrivateMessages", action = "Index", tab = UrlParameter.Optional }, new { tab = @"inbox|sent" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("NewsArchive", "news", new { controller = "News", action = "List" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("NewsRss", "news/rss/{languageId}", new { controller = "News", action = "rss", languageId = UrlParameter.Optional }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("Sitemap", "sitemap", new { controller = "Home", action = "Sitemap" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("SitemapSEO", "sitemap.xml", new { controller = "Home", action = "SitemapSeo" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("StoreClosed", "storeclosed", new { controller = "Home", action = "StoreClosed" }, new[] { "SmartStore.Web.Controllers" }); routes.MapRoute("robots.txt", "robots.txt", new { controller = "Common", action = "RobotsTextFile" }, new[] { "SmartStore.Web.Controllers" }); routes.MapLocalizedRoute("Settings", "settings", new { controller = "Common", action = "Settings" }, new[] { "SmartStore.Web.Controllers" }); }
public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("elmah.axd"); routes.Add(new Route("handl/{pathInfo}", new PersonImageRouteHandler())); routes.IgnoreRoute("handl/{*url}"); routes.MapLocalizedRoute( name: "Default", url: "", defaults: new { controller = "Home", action = "Index" }, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "Home", url: "Home", defaults: new { controller = "Home", action = "Index" }, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "IsSpecialityNameAvailable", url: "IsSpecialityNameAvailable", defaults: new { controller = "BackOffice", action = "IsSpecialityNameAvailable" }, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "IsSpecialityEnglishNameAvailable", url: "IsSpecialityEnglishNameAvailable", defaults: new { controller = "BackOffice", action = "IsSpecialityEnglishNameAvailable" }, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "GetAdvancedSpeciality", url: "getadvancedspeciality/{id}", defaults: new { controller = "Home", action = "GetAdvancedSpeciality", id = UrlParameter.Optional }, setupConstraints: (dynamic constraints) => { }); routes.MapRoute( "GetData", "getdata/{id}/{polinom}", new { controller = "Home", action = "GetData", id = UrlParameter.Optional, polinom = UrlParameter.Optional } ); routes.MapLocalizedRoute( name: "specialities", url: "specialities", defaults: new { controller = "BackOffice", action = "Specialities" }, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "saveSpeciality", url: "BackOffice/EditSpeciality", defaults: new { controller = "BackOffice", action = "EditSpeciality" }, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "editSpeciality", url: "specialities/edit", defaults: new { controller = "BackOffice", action = "EditSpeciality" }, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "addSpeciality", url: "specialities/add", defaults: new { controller = "BackOffice", action = "AddSpeciality", viewModel = UrlParameter.Optional }, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "ChangeCulture", url: "ChangeCulture/{culture}", defaults: new { controller = "LocalizationEngine", action = "ChangeCulture" }, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "TestDb", url: "TestDb", defaults: new { controller = "LocalizationEngine", action = "TestDb" }, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "Login", url: "login", defaults: new { controller = "User", action = "LogIn"}, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "LogOut", url: "logout", defaults: new { controller = "User", action = "LogOut"}, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "DeleteSpeciality", url: "deletespeciality", defaults: new { controller = "BackOffice", action = "DeleteSpeciality" }, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "IndexSpecialities", url: "indexspecialities", defaults: new { controller = "BackOffice", action = "IndexSpecialities" }, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "SearchForSpeaciality", url: "searchforspeaciality", defaults: new { controller = "BackOffice", action = "SearchForSpeaciality" }, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "Import", url: "import", defaults: new { controller = "DataImport", action = "Import" }, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "LocalizedNotFound", url: "{*url}", defaults: new { controller = "Error", action = "Index" }, setupConstraints: (dynamic constraints) => { }); routes.MapRoute( "NotFound", "{*url}", new { controller = "Error", action = "NotFound" } ); }
public void RegisterRoutes(RouteCollection routes) { //We reordered our routes so the most used ones are on top. It can improve performance. //home page routes.MapLocalizedRoute("HomePage", "", new { controller = "Home", action = "Index" }, new[] { "Nop.Web.Controllers" }); //widgets //we have this route for performance optimization because named routes are MUCH faster than usual Html.Action(...) //and this route is highly used routes.MapRoute("WidgetsByZone", "widgetsbyzone/", new { controller = "Widget", action = "WidgetsByZone" }, new[] { "Nop.Web.Controllers" }); //login routes.MapLocalizedRoute("Login", "login/", new { controller = "Customer", action = "Login" }, new[] { "Nop.Web.Controllers" }); //register routes.MapLocalizedRoute("Register", "register/", new { controller = "Customer", action = "Register" }, new[] { "Nop.Web.Controllers" }); //logout routes.MapLocalizedRoute("Logout", "logout/", new { controller = "Customer", action = "Logout" }, new[] { "Nop.Web.Controllers" }); //shopping cart routes.MapLocalizedRoute("ShoppingCart", "cart/", new { controller = "ShoppingCart", action = "Cart" }, new[] { "Nop.Web.Controllers" }); //wishlist routes.MapLocalizedRoute("Wishlist", "wishlist/{customerGuid}", new { controller = "ShoppingCart", action = "Wishlist", customerGuid = UrlParameter.Optional }, new[] { "Nop.Web.Controllers" }); //customer account links routes.MapLocalizedRoute("CustomerInfo", "customer/info", new { controller = "Customer", action = "Info" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerAddresses", "customer/addresses", new { controller = "Customer", action = "Addresses" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerOrders", "order/history", new { controller = "Order", action = "CustomerOrders" }, new[] { "Nop.Web.Controllers" }); //contact us routes.MapLocalizedRoute("ContactUs", "contactus", new { controller = "Common", action = "ContactUs" }, new[] { "Nop.Web.Controllers" }); //sitemap routes.MapLocalizedRoute("Sitemap", "sitemap", new { controller = "Common", action = "Sitemap" }, new[] { "Nop.Web.Controllers" }); //product search routes.MapLocalizedRoute("ProductSearch", "search/", new { controller = "Catalog", action = "Search" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ProductSearchAutoComplete", "catalog/searchtermautocomplete", new { controller = "Catalog", action = "SearchTermAutoComplete" }, new[] { "Nop.Web.Controllers" }); //change currency (AJAX link) routes.MapLocalizedRoute("ChangeCurrency", "changecurrency/{customercurrency}", new { controller = "Common", action = "SetCurrency" }, new { customercurrency = @"\d+" }, new[] { "Nop.Web.Controllers" }); //change language (AJAX link) routes.MapLocalizedRoute("ChangeLanguage", "changelanguage/{langid}", new { controller = "Common", action = "SetLanguage" }, new { langid = @"\d+" }, new[] { "Nop.Web.Controllers" }); //change tax (AJAX link) routes.MapLocalizedRoute("ChangeTaxType", "changetaxtype/{customertaxtype}", new { controller = "Common", action = "SetTaxType" }, new { customertaxtype = @"\d+" }, new[] { "Nop.Web.Controllers" }); //recently viewed products routes.MapLocalizedRoute("RecentlyViewedProducts", "recentlyviewedproducts/", new { controller = "Product", action = "RecentlyViewedProducts" }, new[] { "Nop.Web.Controllers" }); //recently added products routes.MapLocalizedRoute("RecentlyAddedProducts", "newproducts/", new { controller = "Product", action = "RecentlyAddedProducts" }, new[] { "Nop.Web.Controllers" }); //blog routes.MapLocalizedRoute("Blog", "blog", new { controller = "Blog", action = "List" }, new[] { "Nop.Web.Controllers" }); //news routes.MapLocalizedRoute("NewsArchive", "news", new { controller = "News", action = "List" }, new[] { "Nop.Web.Controllers" }); //forum routes.MapLocalizedRoute("Boards", "boards", new { controller = "Boards", action = "Index" }, new[] { "Nop.Web.Controllers" }); //compare products routes.MapLocalizedRoute("CompareProducts", "compareproducts/", new { controller = "Product", action = "CompareProducts" }, new[] { "Nop.Web.Controllers" }); //product tags routes.MapLocalizedRoute("ProductTagsAll", "producttag/all/", new { controller = "Catalog", action = "ProductTagsAll" }, new[] { "Nop.Web.Controllers" }); //manufacturers routes.MapLocalizedRoute("ManufacturerList", "manufacturer/all/", new { controller = "Catalog", action = "ManufacturerAll" }, new[] { "Nop.Web.Controllers" }); //vendors routes.MapLocalizedRoute("VendorList", "vendor/all/", new { controller = "Catalog", action = "VendorAll" }, new[] { "Nop.Web.Controllers" }); //add product to cart (without any attributes and options). used on catalog pages. routes.MapLocalizedRoute("AddProductToCart-Catalog", "addproducttocart/catalog/{productId}/{shoppingCartTypeId}/{quantity}", new { controller = "ShoppingCart", action = "AddProductToCart_Catalog" }, new { productId = @"\d+", shoppingCartTypeId = @"\d+", quantity = @"\d+" }, new[] { "Nop.Web.Controllers" }); //add product to cart (with attributes and options). used on the product details pages. routes.MapLocalizedRoute("AddProductToCart-Details", "addproducttocart/details/{productId}/{shoppingCartTypeId}", new { controller = "ShoppingCart", action = "AddProductToCart_Details" }, new { productId = @"\d+", shoppingCartTypeId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //NJM AUConsignor Begin //add bid to lot - used on the product details pages. //routes.MapLocalizedRoute("AddBidToLot-Details", // "addbidtolot/details/{productId}/{bidAmt}/{bidUid}", // new { controller = "Product", action = "AddBidToLot_Details" }, // // new { productId = @"\d+", bidAmt = @"\d+", bidUid = @"\d+" }, // new { productId = @"\d+"}, // new[] { "Nop.Web.Controllers" }); //HERE //TODO NJM AUConsignor End - put routes where? //product tags routes.MapLocalizedRoute("ProductsByTag", "producttag/{productTagId}/{SeName}", new { controller = "Catalog", action = "ProductsByTag", SeName = UrlParameter.Optional }, new { productTagId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //comparing products routes.MapLocalizedRoute("AddProductToCompare", "compareproducts/add/{productId}", new { controller = "Product", action = "AddProductToCompareList" }, new { productId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //product email a friend routes.MapLocalizedRoute("ProductEmailAFriend", "productemailafriend/{productId}", new { controller = "Product", action = "ProductEmailAFriend" }, new { productId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //reviews routes.MapLocalizedRoute("ProductReviews", "productreviews/{productId}", new { controller = "Product", action = "ProductReviews" }, new[] { "Nop.Web.Controllers" }); //back in stock notifications routes.MapLocalizedRoute("BackInStockSubscribePopup", "backinstocksubscribe/{productId}", new { controller = "BackInStockSubscription", action = "SubscribePopup" }, new { productId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //downloads routes.MapRoute("GetSampleDownload", "download/sample/{productid}", new { controller = "Download", action = "Sample" }, new { productid = @"\d+" }, new[] { "Nop.Web.Controllers" }); //checkout pages routes.MapLocalizedRoute("Checkout", "checkout/", new { controller = "Checkout", action = "Index" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutOnePage", "onepagecheckout/", new { controller = "Checkout", action = "OnePageCheckout" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutShippingAddress", "checkout/shippingaddress", new { controller = "Checkout", action = "ShippingAddress" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutSelectShippingAddress", "checkout/selectshippingaddress", new { controller = "Checkout", action = "SelectShippingAddress" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutBillingAddress", "checkout/billingaddress", new { controller = "Checkout", action = "BillingAddress" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutSelectBillingAddress", "checkout/selectbillingaddress", new { controller = "Checkout", action = "SelectBillingAddress" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutShippingMethod", "checkout/shippingmethod", new { controller = "Checkout", action = "ShippingMethod" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutPaymentMethod", "checkout/paymentmethod", new { controller = "Checkout", action = "PaymentMethod" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutPaymentInfo", "checkout/paymentinfo", new { controller = "Checkout", action = "PaymentInfo" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutConfirm", "checkout/confirm", new { controller = "Checkout", action = "Confirm" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutCompleted", "checkout/completed/{orderId}", new { controller = "Checkout", action = "Completed", orderId = UrlParameter.Optional }, new { orderId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //subscribe newsletters routes.MapLocalizedRoute("SubscribeNewsletter", "subscribenewsletter", new { controller = "Newsletter", action = "SubscribeNewsletter" }, new[] { "Nop.Web.Controllers" }); //email wishlist routes.MapLocalizedRoute("EmailWishlist", "emailwishlist", new { controller = "ShoppingCart", action = "EmailWishlist" }, new[] { "Nop.Web.Controllers" }); //login page for checkout as guest routes.MapLocalizedRoute("LoginCheckoutAsGuest", "login/checkoutasguest", new { controller = "Customer", action = "Login", checkoutAsGuest = true }, new[] { "Nop.Web.Controllers" }); //register result page routes.MapLocalizedRoute("RegisterResult", "registerresult/{resultId}", new { controller = "Customer", action = "RegisterResult" }, new { resultId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //check username availability routes.MapLocalizedRoute("CheckUsernameAvailability", "customer/checkusernameavailability", new { controller = "Customer", action = "CheckUsernameAvailability" }, new[] { "Nop.Web.Controllers" }); //passwordrecovery routes.MapLocalizedRoute("PasswordRecovery", "passwordrecovery", new { controller = "Customer", action = "PasswordRecovery" }, new[] { "Nop.Web.Controllers" }); //password recovery confirmation routes.MapLocalizedRoute("PasswordRecoveryConfirm", "passwordrecovery/confirm", new { controller = "Customer", action = "PasswordRecoveryConfirm" }, new[] { "Nop.Web.Controllers" }); //topics routes.MapLocalizedRoute("TopicPopup", "t-popup/{SystemName}", new { controller = "Topic", action = "TopicDetailsPopup" }, new[] { "Nop.Web.Controllers" }); //blog routes.MapLocalizedRoute("BlogByTag", "blog/tag/{tag}", new { controller = "Blog", action = "BlogByTag" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("BlogByMonth", "blog/month/{month}", new { controller = "Blog", action = "BlogByMonth" }, new[] { "Nop.Web.Controllers" }); //blog RSS routes.MapLocalizedRoute("BlogRSS", "blog/rss/{languageId}", new { controller = "Blog", action = "ListRss" }, new { languageId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //news RSS routes.MapLocalizedRoute("NewsRSS", "news/rss/{languageId}", new { controller = "News", action = "ListRss" }, new { languageId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //set review helpfulness (AJAX link) routes.MapRoute("SetProductReviewHelpfulness", "setproductreviewhelpfulness", new { controller = "Product", action = "SetProductReviewHelpfulness" }, new[] { "Nop.Web.Controllers" }); //customer account links routes.MapLocalizedRoute("CustomerReturnRequests", "returnrequest/history", new { controller = "ReturnRequest", action = "CustomerReturnRequests" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerDownloadableProducts", "customer/downloadableproducts", new { controller = "Customer", action = "DownloadableProducts" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerBackInStockSubscriptions", "backinstocksubscriptions/manage", new { controller = "BackInStockSubscription", action = "CustomerSubscriptions" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerBackInStockSubscriptionsPaged", "backinstocksubscriptions/manage/{page}", new { controller = "BackInStockSubscription", action = "CustomerSubscriptions", page = UrlParameter.Optional }, new { page = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerRewardPoints", "rewardpoints/history", new { controller = "Order", action = "CustomerRewardPoints" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerChangePassword", "customer/changepassword", new { controller = "Customer", action = "ChangePassword" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerAvatar", "customer/avatar", new { controller = "Customer", action = "Avatar" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("AccountActivation", "customer/activation", new { controller = "Customer", action = "AccountActivation" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerForumSubscriptions", "boards/forumsubscriptions", new { controller = "Boards", action = "CustomerForumSubscriptions" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerForumSubscriptionsPaged", "boards/forumsubscriptions/{page}", new { controller = "Boards", action = "CustomerForumSubscriptions", page = UrlParameter.Optional }, new { page = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerAddressDelete", "customer/addressdelete/{addressId}", new { controller = "Customer", action = "AddressDelete" }, new { addressId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerAddressEdit", "customer/addressedit/{addressId}", new { controller = "Customer", action = "AddressEdit" }, new { addressId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerAddressAdd", "customer/addressadd", new { controller = "Customer", action = "AddressAdd" }, new[] { "Nop.Web.Controllers" }); //customer profile page routes.MapLocalizedRoute("CustomerProfile", "profile/{id}", new { controller = "Profile", action = "Index" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerProfilePaged", "profile/{id}/page/{page}", new { controller = "Profile", action = "Index" }, new { id = @"\d+", page = @"\d+" }, new[] { "Nop.Web.Controllers" }); //orders routes.MapLocalizedRoute("OrderDetails", "orderdetails/{orderId}", new { controller = "Order", action = "Details" }, new { orderId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ShipmentDetails", "orderdetails/shipment/{shipmentId}", new { controller = "Order", action = "ShipmentDetails" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ReturnRequest", "returnrequest/{orderId}", new { controller = "ReturnRequest", action = "ReturnRequest" }, new { orderId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ReOrder", "reorder/{orderId}", new { controller = "Order", action = "ReOrder" }, new { orderId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("GetOrderPdfInvoice", "orderdetails/pdf/{orderId}", new { controller = "Order", action = "GetPdfInvoice" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PrintOrderDetails", "orderdetails/print/{orderId}", new { controller = "Order", action = "PrintOrderDetails" }, new[] { "Nop.Web.Controllers" }); //order downloads routes.MapRoute("GetDownload", "download/getdownload/{orderItemId}/{agree}", new { controller = "Download", action = "GetDownload", agree = UrlParameter.Optional }, new { orderItemId = new GuidConstraint(false) }, new[] { "Nop.Web.Controllers" }); routes.MapRoute("GetLicense", "download/getlicense/{orderItemId}/", new { controller = "Download", action = "GetLicense" }, new { orderItemId = new GuidConstraint(false) }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("DownloadUserAgreement", "customer/useragreement/{orderItemId}", new { controller = "Customer", action = "UserAgreement" }, new { orderItemId = new GuidConstraint(false) }, new[] { "Nop.Web.Controllers" }); routes.MapRoute("GetOrderNoteFile", "download/ordernotefile/{ordernoteid}", new { controller = "Download", action = "GetOrderNoteFile" }, new { ordernoteid = @"\d+" }, new[] { "Nop.Web.Controllers" }); //contact vendor routes.MapLocalizedRoute("ContactVendor", "contactvendor/{vendorId}", new { controller = "Common", action = "ContactVendor" }, new[] { "Nop.Web.Controllers" }); //poll vote AJAX link routes.MapLocalizedRoute("PollVote", "poll/vote", new { controller = "Poll", action = "Vote" }, new[] { "Nop.Web.Controllers" }); //comparing products routes.MapLocalizedRoute("RemoveProductFromCompareList", "compareproducts/remove/{productId}", new { controller = "Product", action = "RemoveProductFromCompareList" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ClearCompareList", "clearcomparelist/", new { controller = "Product", action = "ClearCompareList" }, new[] { "Nop.Web.Controllers" }); //recently added products RSS routes.MapLocalizedRoute("RecentlyAddedProductsRSS", "newproducts/rss", new { controller = "Product", action = "RecentlyAddedProductsRss" }, new[] { "Nop.Web.Controllers" }); //get state list by country ID (AJAX link) routes.MapRoute("GetStatesByCountryId", "country/getstatesbycountryid/", new { controller = "Country", action = "GetStatesByCountryId" }, new[] { "Nop.Web.Controllers" }); //EU Cookie law accept button handler (AJAX link) routes.MapRoute("EuCookieLawAccept", "eucookielawaccept", new { controller = "Common", action = "EuCookieLawAccept" }, new[] { "Nop.Web.Controllers" }); //authenticate topic AJAX link routes.MapLocalizedRoute("TopicAuthenticate", "topic/authenticate", new { controller = "Topic", action = "Authenticate" }, new[] { "Nop.Web.Controllers" }); //product attributes with "upload file" type routes.MapLocalizedRoute("UploadFileProductAttribute", "uploadfileproductattribute/{attributeId}", new { controller = "ShoppingCart", action = "UploadFileProductAttribute" }, new { attributeId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //checkout attributes with "upload file" type routes.MapLocalizedRoute("UploadFileCheckoutAttribute", "uploadfilecheckoutattribute/{attributeId}", new { controller = "ShoppingCart", action = "UploadFileCheckoutAttribute" }, new { attributeId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //forums routes.MapLocalizedRoute("ActiveDiscussions", "boards/activediscussions", new { controller = "Boards", action = "ActiveDiscussions" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ActiveDiscussionsPaged", "boards/activediscussions/page/{page}", new { controller = "Boards", action = "ActiveDiscussions", page = UrlParameter.Optional }, new { page = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ActiveDiscussionsRSS", "boards/activediscussionsrss", new { controller = "Boards", action = "ActiveDiscussionsRSS" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PostEdit", "boards/postedit/{id}", new { controller = "Boards", action = "PostEdit" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PostDelete", "boards/postdelete/{id}", new { controller = "Boards", action = "PostDelete" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PostCreate", "boards/postcreate/{id}", new { controller = "Boards", action = "PostCreate" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PostCreateQuote", "boards/postcreate/{id}/{quote}", new { controller = "Boards", action = "PostCreate" }, new { id = @"\d+", quote = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicEdit", "boards/topicedit/{id}", new { controller = "Boards", action = "TopicEdit" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicDelete", "boards/topicdelete/{id}", new { controller = "Boards", action = "TopicDelete" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicCreate", "boards/topiccreate/{id}", new { controller = "Boards", action = "TopicCreate" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicMove", "boards/topicmove/{id}", new { controller = "Boards", action = "TopicMove" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicWatch", "boards/topicwatch/{id}", new { controller = "Boards", action = "TopicWatch" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicSlug", "boards/topic/{id}/{slug}", new { controller = "Boards", action = "Topic", slug = UrlParameter.Optional }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicSlugPaged", "boards/topic/{id}/{slug}/page/{page}", new { controller = "Boards", action = "Topic", slug = UrlParameter.Optional, page = UrlParameter.Optional }, new { id = @"\d+", page = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ForumWatch", "boards/forumwatch/{id}", new { controller = "Boards", action = "ForumWatch" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ForumRSS", "boards/forumrss/{id}", new { controller = "Boards", action = "ForumRSS" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ForumSlug", "boards/forum/{id}/{slug}", new { controller = "Boards", action = "Forum", slug = UrlParameter.Optional }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ForumSlugPaged", "boards/forum/{id}/{slug}/page/{page}", new { controller = "Boards", action = "Forum", slug = UrlParameter.Optional, page = UrlParameter.Optional }, new { id = @"\d+", page = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ForumGroupSlug", "boards/forumgroup/{id}/{slug}", new { controller = "Boards", action = "ForumGroup", slug = UrlParameter.Optional }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("Search", "boards/search", new { controller = "Boards", action = "Search" }, new[] { "Nop.Web.Controllers" }); //private messages routes.MapLocalizedRoute("PrivateMessages", "privatemessages/{tab}", new { controller = "PrivateMessages", action = "Index", tab = UrlParameter.Optional }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PrivateMessagesPaged", "privatemessages/{tab}/page/{page}", new { controller = "PrivateMessages", action = "Index", tab = UrlParameter.Optional }, new { page = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PrivateMessagesInbox", "inboxupdate", new { controller = "PrivateMessages", action = "InboxUpdate" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PrivateMessagesSent", "sentupdate", new { controller = "PrivateMessages", action = "SentUpdate" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("SendPM", "sendpm/{toCustomerId}", new { controller = "PrivateMessages", action = "SendPM" }, new { toCustomerId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("SendPMReply", "sendpm/{toCustomerId}/{replyToMessageId}", new { controller = "PrivateMessages", action = "SendPM" }, new { toCustomerId = @"\d+", replyToMessageId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ViewPM", "viewpm/{privateMessageId}", new { controller = "PrivateMessages", action = "ViewPM" }, new { privateMessageId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("DeletePM", "deletepm/{privateMessageId}", new { controller = "PrivateMessages", action = "DeletePM" }, new { privateMessageId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //activate newsletters routes.MapLocalizedRoute("NewsletterActivation", "newsletter/subscriptionactivation/{token}/{active}", new { controller = "Newsletter", action = "SubscriptionActivation" }, new { token = new GuidConstraint(false) }, new[] { "Nop.Web.Controllers" }); //robots.txt routes.MapRoute("robots.txt", "robots.txt", new { controller = "Common", action = "RobotsTextFile" }, new[] { "Nop.Web.Controllers" }); //sitemap (XML) routes.MapLocalizedRoute("sitemap.xml", "sitemap.xml", new { controller = "Common", action = "SitemapXml" }, new[] { "Nop.Web.Controllers" }); //store closed routes.MapLocalizedRoute("StoreClosed", "storeclosed", new { controller = "Common", action = "StoreClosed" }, new[] { "Nop.Web.Controllers" }); //install routes.MapRoute("Installation", "install", new { controller = "Install", action = "Index" }, new[] { "Nop.Web.Controllers" }); //page not found routes.MapLocalizedRoute("PageNotFound", "page-not-found", new { controller = "Common", action = "PageNotFound" }, new[] { "Nop.Web.Controllers" }); }
public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("elmah.axd"); routes.MapLocalizedRoute( name: "Default", url: "", defaults: new { controller = "Home", action = "Index" }, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "Home", url: "Home", defaults: new { controller = "Home", action = "Index" }, setupConstraints: (dynamic constraints) => { }); routes.MapRoute( "GetData", "getdata/{polinom}", new { controller = "Home", action = "GetData", polinom = UrlParameter.Optional} ); routes.MapLocalizedRoute( name: "specialities", url: "specialities", defaults: new { controller = "BackOffice", action = "Specialities" }, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "saveSpeciality", url: "BackOffice/Save", defaults: new { controller = "BackOffice", action = "Save" }, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "editSpeciality", url: "specialities/edit", defaults: new { controller = "BackOffice", action = "EditSpecialities" }, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "ChangeCulture", url: "ChangeCulture/{culture}", defaults: new { controller = "LocalizationEngine", action = "ChangeCulture" }, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "TestDb", url: "TestDb", defaults: new { controller = "LocalizationEngine", action = "TestDb" }, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "Login", url: "login", defaults: new { controller = "User", action = "LogIn"}, setupConstraints: (dynamic constraints) => { }); routes.MapLocalizedRoute( name: "LogOut", url: "logout", defaults: new { controller = "User", action = "LogOut"}, setupConstraints: (dynamic constraints) => { }); routes.MapRoute( "NotFound", "{*url}", new { controller = "Error", action = "Index" } ); }
public void RegisterRoutes(RouteCollection routes) { //home page routes.MapLocalizedRoute("HomePage", "", new { controller = "Home", action = "Index"}, new[] { "Nop.Web.Controllers" }); //products routes.MapLocalizedRoute("Product", "producto/{productId}/{SeName}", new { controller = "Catalog", action = "Product",SeName = UrlParameter.Optional }, new { productId = @"\d+" }, //expresión regular que indica que productId ha de ser un número new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("RecentlyViewedProducts", "recentlyviewedproducts/", new { controller = "Catalog", action = "RecentlyViewedProducts" }, new[] { "Nop.Web.Controllers" }); // Añadido Cmas routes.MapLocalizedRoute("HomePageBestSellers", "topventas/", new { controller = "Catalog", action = "HomePageBestSellers" }, new[] { "Nop.Web.Controllers" }); // fin Cmas routes.MapLocalizedRoute("RecentlyAddedProducts", "newproducts/", new { controller = "Catalog", action = "RecentlyAddedProducts" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("RecentlyAddedProductsRSS", "newproducts/rss", new { controller = "Catalog", action = "RecentlyAddedProductsRss" }, new[] { "Nop.Web.Controllers" }); //comparing products routes.MapLocalizedRoute("AddProductToCompare", "compareproducts/add/{productId}", new { controller = "Catalog", action = "AddProductToCompareList" }, new { productId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CompareProducts", "compareproducts/", new { controller = "Catalog", action = "CompareProducts" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("RemoveProductFromCompareList", "compareproducts/remove/{productId}", new { controller = "Catalog", action = "RemoveProductFromCompareList"}, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ClearCompareList", "clearcomparelist/", new { controller = "Catalog", action = "ClearCompareList" }, new[] { "Nop.Web.Controllers" }); //product email a friend routes.MapLocalizedRoute("ProductEmailAFriend", "productemailafriend/{productId}", new { controller = "Catalog", action = "ProductEmailAFriend" }, new { productId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //catalog routes.MapLocalizedRoute("Category", "c/{categoryId}/{SeName}", new { controller = "Catalog", action = "Category", SeName = UrlParameter.Optional }, new { categoryId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ManufacturerList", "manufacturer/all/", new { controller = "Catalog", action = "ManufacturerAll" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("Manufacturer", "m/{manufacturerId}/{SeName}", new { controller = "Catalog", action = "Manufacturer", SeName = UrlParameter.Optional }, new { manufacturerId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //reviews routes.MapLocalizedRoute("ProductReviews", "productreviews/{productId}", new { controller = "Catalog", action = "ProductReviews" }, new[] { "Nop.Web.Controllers" }); //back in stock notifications routes.MapLocalizedRoute("BackInStockSubscribePopup", "backinstocksubscribe/{productVariantId}", new { controller = "Catalog", action = "BackInStockSubscribePopup" }, new { productVariantId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("DeleteBackInStockSubscription", "backinstocksubscribe/delete/{subscriptionId}", new { controller = "Customer", action = "DeleteBackInStockSubscription" }, new { subscriptionId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //login, register routes.MapLocalizedRoute("Login", "login/", new { controller = "Customer", action = "Login" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("LoginCheckoutAsGuest", "login/checkoutasguest", new { controller = "Customer", action = "Login", checkoutAsGuest = true }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("Register", "register/", new { controller = "Customer", action = "Register" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("Logout", "logout/", new { controller = "Customer", action = "Logout" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("RegisterResult", "registerresult/{resultId}", new { controller = "Customer", action = "RegisterResult" }, new { resultId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //shopping cart routes.MapLocalizedRoute("AddProductToCart", "cart/addproduct/{productId}", new { controller = "ShoppingCart", action = "AddProductToCart" }, new { productId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ShoppingCart", "cart/", new { controller = "ShoppingCart", action = "Cart" }, new[] { "Nop.Web.Controllers" }); //wishlist routes.MapLocalizedRoute("Wishlist", "wishlist/{customerGuid}", new { controller = "ShoppingCart", action = "Wishlist", customerGuid = UrlParameter.Optional }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("EmailWishlist", "emailwishlist", new { controller = "ShoppingCart", action = "EmailWishlist" }, new[] { "Nop.Web.Controllers" }); //checkout routes.MapLocalizedRoute("Checkout", "checkout/", new { controller = "Checkout", action = "Index" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutOnePage", "onepagecheckout/", new { controller = "Checkout", action = "OnePageCheckout" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutShippingAddress", "checkout/shippingaddress", new { controller = "Checkout", action = "ShippingAddress" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutSelectShippingAddress", "checkout/selectshippingaddress", new { controller = "Checkout", action = "SelectShippingAddress" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutBillingAddress", "checkout/billingaddress", new { controller = "Checkout", action = "BillingAddress" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutSelectBillingAddress", "checkout/selectbillingaddress", new { controller = "Checkout", action = "SelectBillingAddress" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutShippingMethod", "checkout/shippingmethod", new { controller = "Checkout", action = "ShippingMethod" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutPaymentMethod", "checkout/paymentmethod", new { controller = "Checkout", action = "PaymentMethod" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutPaymentInfo", "checkout/paymentinfo", new { controller = "Checkout", action = "PaymentInfo" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutConfirm", "checkout/confirm", new { controller = "Checkout", action = "Confirm" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutCompleted", "checkout/completed", new { controller = "Checkout", action = "Completed" }, new[] { "Nop.Web.Controllers" }); //orders routes.MapLocalizedRoute("OrderDetails", "orderdetails/{orderId}", new { controller = "Order", action = "Details" }, new { orderId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ShipmentDetails", "orderdetails/shipment/{shipmentId}", new { controller = "Order", action = "ShipmentDetails" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ReturnRequest", "returnrequest/{orderId}", new { controller = "Order", action = "ReturnRequest" }, new { orderId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ReOrder", "reorder/{orderId}", new { controller = "Order", action = "ReOrder" }, new { orderId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("GetOrderPdfInvoice", "orderdetails/pdf/{orderId}", new { controller = "Order", action = "GetPdfInvoice" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PrintOrderDetails", "orderdetails/print/{orderId}", new { controller = "Order", action = "PrintOrderDetails" }, new[] { "Nop.Web.Controllers" }); //contact us routes.MapLocalizedRoute("ContactUs", "contactus", new { controller = "Common", action = "ContactUs" }, new[] { "Nop.Web.Controllers" }); //passwordrecovery routes.MapLocalizedRoute("PasswordRecovery", "passwordrecovery", new { controller = "Customer", action = "PasswordRecovery" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PasswordRecoveryConfirm", "passwordrecovery/confirm", new { controller = "Customer", action = "PasswordRecoveryConfirm" }, new[] { "Nop.Web.Controllers" }); //newsletters routes.MapLocalizedRoute("NewsletterActivation", "newsletter/subscriptionactivation/{token}/{active}", new { controller = "Newsletter", action = "SubscriptionActivation" }, new { token = new GuidConstraint(false) }, new[] { "Nop.Web.Controllers" }); //customer routes.MapLocalizedRoute("CustomerMyAccount", "customer/myaccount", new { controller = "Customer", action = "MyAccount" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerInfo", "customer/info", new { controller = "Customer", action = "Info" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerAddresses", "customer/addresses", new { controller = "Customer", action = "Addresses" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerOrders", "customer/orders", new { controller = "Customer", action = "Orders" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerReturnRequests", "customer/returnrequests", new { controller = "Customer", action = "ReturnRequests" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerDownloadableProducts", "customer/downloadableproducts", new { controller = "Customer", action = "DownloadableProducts" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerBackInStockSubscriptions", "customer/backinstocksubscriptions", new { controller = "Customer", action = "BackInStockSubscriptions" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerBackInStockSubscriptionsPaged", "customer/backinstocksubscriptions/{page}", new { controller = "Customer", action = "BackInStockSubscriptions", page = UrlParameter.Optional }, new { page = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerRewardPoints", "customer/rewardpoints", new { controller = "Customer", action = "RewardPoints" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerChangePassword", "customer/changepassword", new { controller = "Customer", action = "ChangePassword" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerAvatar", "customer/avatar", new { controller = "Customer", action = "Avatar" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("AccountActivation", "customer/activation", new { controller = "Customer", action = "AccountActivation" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerProfile", "profile/{id}", new { controller = "Profile", action = "Index" }, new { id = @"\d+"}, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerProfilePaged", "profile/{id}/page/{page}", new { controller = "Profile", action = "Index"}, new { id = @"\d+", page = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerForumSubscriptions", "customer/forumsubscriptions", new { controller = "Customer", action = "ForumSubscriptions"}, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerForumSubscriptionsPaged", "customer/forumsubscriptions/{page}", new { controller = "Customer", action = "ForumSubscriptions", page = UrlParameter.Optional }, new { page = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("DeleteForumSubscription", "customer/forumsubscriptions/delete/{subscriptionId}", new { controller = "Customer", action = "DeleteForumSubscription" }, new { subscriptionId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //addresses routes.MapLocalizedRoute("CustomerAddressDelete", "customer/addressdelete/{addressId}", new { controller = "Customer", action = "AddressDelete" }, new { addressId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerAddressEdit", "customer/addressedit/{addressId}", new { controller = "Customer", action = "AddressEdit" }, new { addressId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("CustomerAddressAdd", "customer/addressadd", new { controller = "Customer", action = "AddressAdd" }, new[] { "Nop.Web.Controllers" }); //blog routes.MapLocalizedRoute("Blog", "blog", new { controller = "Blog", action = "List" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("BlogRSS", "blog/rss/{languageId}", new { controller = "Blog", action = "ListRss" }, new { languageId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("BlogPost", "blog/{blogPostId}/{SeName}", new { controller = "Blog", action = "BlogPost", SeName = UrlParameter.Optional }, new { blogPostId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("BlogByTag", "blog/tag/{tag}", new { controller = "Blog", action = "List" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("BlogByMonth", "blog/month/{month}", new { controller = "Blog", action = "List" }, new[] { "Nop.Web.Controllers" }); //forum routes.MapLocalizedRoute("Boards", "boards", new { controller = "Boards", action = "Index" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ActiveDiscussions", "boards/activediscussions", new { controller = "Boards", action = "ActiveDiscussions" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ActiveDiscussionsRSS", "boards/activediscussionsrss", new { controller = "Boards", action = "ActiveDiscussionsRSS" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PostEdit", "boards/postedit/{id}", new { controller = "Boards", action = "PostEdit" }, new { id = @"\d+"}, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PostDelete", "boards/postdelete/{id}", new { controller = "Boards", action = "PostDelete" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PostCreate", "boards/postcreate/{id}", new { controller = "Boards", action = "PostCreate"}, new { id = @"\d+"}, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PostCreateQuote", "boards/postcreate/{id}/{quote}", new { controller = "Boards", action = "PostCreate"}, new { id = @"\d+", quote = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicEdit", "boards/topicedit/{id}", new { controller = "Boards", action = "TopicEdit"}, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicDelete", "boards/topicdelete/{id}", new { controller = "Boards", action = "TopicDelete"}, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicCreate", "boards/topiccreate/{id}", new { controller = "Boards", action = "TopicCreate" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicMove", "boards/topicmove/{id}", new { controller = "Boards", action = "TopicMove" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicWatch", "boards/topicwatch/{id}", new { controller = "Boards", action = "TopicWatch" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicSlug", "boards/topic/{id}/{slug}", new { controller = "Boards", action = "Topic", slug = UrlParameter.Optional }, new { id = @"\d+"}, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicSlugPaged", "boards/topic/{id}/{slug}/page/{page}", new { controller = "Boards", action = "Topic", slug = UrlParameter.Optional, page = UrlParameter.Optional }, new { id = @"\d+", page = @"\d+"}, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ForumWatch", "boards/forumwatch/{id}", new { controller = "Boards", action = "ForumWatch" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ForumRSS", "boards/forumrss/{id}", new { controller = "Boards", action = "ForumRSS" }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ForumSlug", "boards/forum/{id}/{slug}", new { controller = "Boards", action = "Forum", slug = UrlParameter.Optional }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ForumSlugPaged", "boards/forum/{id}/{slug}/page/{page}", new { controller = "Boards", action = "Forum", slug = UrlParameter.Optional, page = UrlParameter.Optional }, new { id = @"\d+", page = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ForumGroupSlug", "boards/forumgroup/{id}/{slug}", new { controller = "Boards", action = "ForumGroup", slug = UrlParameter.Optional }, new { id = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("Search", "boards/search", new { controller = "Boards", action = "Search" }, new[] { "Nop.Web.Controllers" }); //private messages routes.MapLocalizedRoute("PrivateMessages", "privatemessages/{tab}", new { controller = "PrivateMessages", action = "Index", tab = UrlParameter.Optional }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PrivateMessagesPaged", "privatemessages/{tab}/page/{page}", new { controller = "PrivateMessages", action = "Index", tab = UrlParameter.Optional }, new { page = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PrivateMessagesInbox", "inboxupdate", new { controller = "PrivateMessages", action = "InboxUpdate" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("PrivateMessagesSent", "sentupdate", new { controller = "PrivateMessages", action = "SentUpdate" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("SendPM", "sendpm/{toCustomerId}", new { controller = "PrivateMessages", action = "SendPM" }, new { toCustomerId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("SendPMReply", "sendpm/{toCustomerId}/{replyToMessageId}", new { controller = "PrivateMessages", action = "SendPM" }, new { toCustomerId = @"\d+", replyToMessageId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("ViewPM", "viewpm/{privateMessageId}", new { controller = "PrivateMessages", action = "ViewPM" }, new { privateMessageId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("DeletePM", "deletepm/{privateMessageId}", new { controller = "PrivateMessages", action = "DeletePM" }, new { privateMessageId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //news routes.MapLocalizedRoute("NewsArchive", "news", new { controller = "News", action = "List" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("NewsRSS", "news/rss/{languageId}", new { controller = "News", action = "ListRss" }, new { languageId = @"\d+" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("NewsItem", "news/{newsItemId}/{SeName}", new { controller = "News", action = "NewsItem", SeName = UrlParameter.Optional }, new { newsItemId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //topics routes.MapLocalizedRoute("Topic", "t/{SystemName}", new { controller = "Topic", action = "TopicDetails" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("TopicPopup", "t-popup/{SystemName}", new { controller = "Topic", action = "TopicDetailsPopup" }, new[] { "Nop.Web.Controllers" }); //sitemaps routes.MapLocalizedRoute("Sitemap", "sitemap", new { controller = "Common", action = "Sitemap" }, new[] { "Nop.Web.Controllers" }); routes.MapLocalizedRoute("SitemapSEO", "sitemapseo", new { controller = "Common", action = "SitemapSeo" }, new[] { "Nop.Web.Controllers" }); //product tags routes.MapLocalizedRoute("ProductsByTag", "productag/{productTagId}/{SeName}", new { controller = "Catalog", action = "ProductsByTag", SeName = UrlParameter.Optional }, new { productTagId = @"\d+" }, new[] { "Nop.Web.Controllers" }); //product search routes.MapLocalizedRoute("ProductSearch", "search/", new { controller = "Catalog", action = "Search" }, new[] { "Nop.Web.Controllers" }); //config routes.MapLocalizedRoute("Config", "config", new { controller = "Common", action = "Config" }, new[] { "Nop.Web.Controllers" }); }
public void RegisterRoutes(RouteCollection routes) { // đăng ký các route chính yếu nhất của website. Ghi nhớ là hệ thống route này ko cho phép ta có thể đa ngôn ngữ url dạng // dang-ky;register mà chỉ dùng được duy nhất 1 url là register. Đa ngôn ngữ chỉ có thể dùng với cơ chế url của // GenericRoute, chỉ 1 phân đoạn, khá hạn chế // Đẩy KeepAlive lên đầu vì đây là url cần được xử lý nhanh nhất, thậm chí đối với Url này, chúng ta cần tránh tất cả mọi công đoạn có thể // làm suy giảm hiệu năng như là tìm store hiện hành, tìm language hiện hành, ..v.v.v. // Tất cả những gì mà KeepAlive chỉ là theo định kỳ gọi đến để duy trì Session, chỉ có thế // link cho KeepAlive sẽ ko có phân đoạn ngôn ngữ, vì ko cần phải có nó // sẽ chỉnh sửa thêm .... routes.MapRoute("KeepAlive", "keepalive/index", new { controller = "KeepAlive", action = "Index" }, new[] { "Research.Web.Controllers" }); //home page routes.MapLocalizedRoute("HomePage", "", new { controller = "Home", action = "Index" }, new[] { "Research.Web.Controllers" }); // route này ko dùng LocalizedRoute, đồng nghĩa với việc nó sẽ ko thể hỗ trợ phân đoạn ngôn ngữ trong url //widgets //we have this route for performance optimization because named routes are MUCH faster than usual Html.Action(...) //and this route is highly used routes.MapRoute("WidgetsByZone", "widgetsbyzone/", new { controller = "Widget", action = "WidgetsByZone" }, new[] { "Research.Web.Controllers" }); //login // sử dụng LocalizedRoute chỉ là để cho phép url có thể có thêm các phân đoạn ngôn ngữ mà vẫn được // phân giải link tới 1 cách bình thường, và được add thêm phân đoạn ngôn ngữ với link sinh trong view, chứ chả có gì đặc biệt routes.MapLocalizedRoute("Login", "login/", new { controller = "Customer", action = "Login" }, new[] { "Research.Web.Controllers" }); //register routes.MapLocalizedRoute("Register", "register/", new { controller = "Customer", action = "Register" }, new[] { "Research.Web.Controllers" }); //logout routes.MapLocalizedRoute("Logout", "logout/", new { controller = "Customer", action = "Logout" }, new[] { "Research.Web.Controllers" }); //shopping cart routes.MapLocalizedRoute("ShoppingCart", "cart/", new { controller = "ShoppingCart", action = "Cart" }, new[] { "Research.Web.Controllers" }); //wishlist routes.MapLocalizedRoute("Wishlist", "wishlist/{customerGuid}", new { controller = "ShoppingCart", action = "Wishlist", customerGuid = UrlParameter.Optional }, new[] { "Research.Web.Controllers" }); //customer account links routes.MapLocalizedRoute("CustomerInfo", "customer/info", new { controller = "Customer", action = "Info" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CustomerAddresses", "customer/addresses", new { controller = "Customer", action = "Addresses" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CustomerOrders", "order/history", new { controller = "Order", action = "CustomerOrders" }, new[] { "Research.Web.Controllers" }); //contact us routes.MapLocalizedRoute("ContactUs", "contactus", new { controller = "Common", action = "ContactUs" }, new[] { "Research.Web.Controllers" }); //sitemap routes.MapLocalizedRoute("Sitemap", "sitemap", new { controller = "Common", action = "Sitemap" }, new[] { "Research.Web.Controllers" }); //product search routes.MapLocalizedRoute("ProductSearch", "search/", new { controller = "Catalog", action = "Search" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("ProductSearchAutoComplete", "catalog/searchtermautocomplete", new { controller = "Catalog", action = "SearchTermAutoComplete" }, new[] { "Research.Web.Controllers" }); //change currency (AJAX link) routes.MapLocalizedRoute("ChangeCurrency", "changecurrency/{customercurrency}", new { controller = "Common", action = "SetCurrency" }, new { customercurrency = @"\d+" }, new[] { "Research.Web.Controllers" }); //change language (AJAX link) routes.MapLocalizedRoute("ChangeLanguage", "changelanguage/{langid}", new { controller = "Common", action = "SetLanguage" }, new { langid = @"\d+" }, new[] { "Research.Web.Controllers" }); //change tax (AJAX link) routes.MapLocalizedRoute("ChangeTaxType", "changetaxtype/{customertaxtype}", new { controller = "Common", action = "SetTaxType" }, new { customertaxtype = @"\d+" }, new[] { "Research.Web.Controllers" }); //recently viewed products routes.MapLocalizedRoute("RecentlyViewedProducts", "recentlyviewedproducts/", new { controller = "Product", action = "RecentlyViewedProducts" }, new[] { "Research.Web.Controllers" }); //recently added products routes.MapLocalizedRoute("RecentlyAddedProducts", "newproducts/", new { controller = "Product", action = "RecentlyAddedProducts" }, new[] { "Research.Web.Controllers" }); //blog routes.MapLocalizedRoute("Blog", "blog", new { controller = "Blog", action = "List" }, new[] { "Research.Web.Controllers" }); //news routes.MapLocalizedRoute("NewsArchive", "news", new { controller = "News", action = "List" }, new[] { "Research.Web.Controllers" }); //forum routes.MapLocalizedRoute("Boards", "boards", new { controller = "Boards", action = "Index" }, new[] { "Research.Web.Controllers" }); //compare products routes.MapLocalizedRoute("CompareProducts", "compareproducts/", new { controller = "Product", action = "CompareProducts" }, new[] { "Research.Web.Controllers" }); //product tags routes.MapLocalizedRoute("ProductTagsAll", "producttag/all/", new { controller = "Catalog", action = "ProductTagsAll" }, new[] { "Research.Web.Controllers" }); //manufacturers routes.MapLocalizedRoute("ManufacturerList", "manufacturer/all/", new { controller = "Catalog", action = "ManufacturerAll" }, new[] { "Research.Web.Controllers" }); //vendors routes.MapLocalizedRoute("VendorList", "vendor/all/", new { controller = "Catalog", action = "VendorAll" }, new[] { "Research.Web.Controllers" }); //add product to cart (without any attributes and options). used on catalog pages. routes.MapLocalizedRoute("AddProductToCart-Catalog", "addproducttocart/catalog/{productId}/{shoppingCartTypeId}/{quantity}", new { controller = "ShoppingCart", action = "AddProductToCart_Catalog" }, new { productId = @"\d+", shoppingCartTypeId = @"\d+", quantity = @"\d+" }, new[] { "Research.Web.Controllers" }); //add product to cart (with attributes and options). used on the product details pages. routes.MapLocalizedRoute("AddProductToCart-Details", "addproducttocart/details/{productId}/{shoppingCartTypeId}", new { controller = "ShoppingCart", action = "AddProductToCart_Details" }, new { productId = @"\d+", shoppingCartTypeId = @"\d+" }, new[] { "Research.Web.Controllers" }); //product tags routes.MapLocalizedRoute("ProductsByTag", "producttag/{productTagId}/{SeName}", new { controller = "Catalog", action = "ProductsByTag", SeName = UrlParameter.Optional }, new { productTagId = @"\d+" }, new[] { "Research.Web.Controllers" }); //comparing products routes.MapLocalizedRoute("AddProductToCompare", "compareproducts/add/{productId}", new { controller = "Product", action = "AddProductToCompareList" }, new { productId = @"\d+" }, new[] { "Research.Web.Controllers" }); //product email a friend routes.MapLocalizedRoute("ProductEmailAFriend", "productemailafriend/{productId}", new { controller = "Product", action = "ProductEmailAFriend" }, new { productId = @"\d+" }, new[] { "Research.Web.Controllers" }); //reviews routes.MapLocalizedRoute("ProductReviews", "productreviews/{productId}", new { controller = "Product", action = "ProductReviews" }, new[] { "Research.Web.Controllers" }); //back in stock notifications routes.MapLocalizedRoute("BackInStockSubscribePopup", "backinstocksubscribe/{productId}", new { controller = "BackInStockSubscription", action = "SubscribePopup" }, new { productId = @"\d+" }, new[] { "Research.Web.Controllers" }); //downloads routes.MapRoute("GetSampleDownload", "download/sample/{productid}", new { controller = "Download", action = "Sample" }, new { productid = @"\d+" }, new[] { "Research.Web.Controllers" }); //checkout pages routes.MapLocalizedRoute("Checkout", "checkout/", new { controller = "Checkout", action = "Index" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutOnePage", "onepagecheckout/", new { controller = "Checkout", action = "OnePageCheckout" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutShippingAddress", "checkout/shippingaddress", new { controller = "Checkout", action = "ShippingAddress" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutSelectShippingAddress", "checkout/selectshippingaddress", new { controller = "Checkout", action = "SelectShippingAddress" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutBillingAddress", "checkout/billingaddress", new { controller = "Checkout", action = "BillingAddress" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutSelectBillingAddress", "checkout/selectbillingaddress", new { controller = "Checkout", action = "SelectBillingAddress" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutShippingMethod", "checkout/shippingmethod", new { controller = "Checkout", action = "ShippingMethod" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutPaymentMethod", "checkout/paymentmethod", new { controller = "Checkout", action = "PaymentMethod" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutPaymentInfo", "checkout/paymentinfo", new { controller = "Checkout", action = "PaymentInfo" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutConfirm", "checkout/confirm", new { controller = "Checkout", action = "Confirm" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CheckoutCompleted", "checkout/completed/{orderId}", new { controller = "Checkout", action = "Completed", orderId = UrlParameter.Optional }, new { orderId = @"\d+" }, new[] { "Research.Web.Controllers" }); //subscribe newsletters routes.MapLocalizedRoute("SubscribeNewsletter", "subscribenewsletter", new { controller = "Newsletter", action = "SubscribeNewsletter" }, new[] { "Research.Web.Controllers" }); //email wishlist routes.MapLocalizedRoute("EmailWishlist", "emailwishlist", new { controller = "ShoppingCart", action = "EmailWishlist" }, new[] { "Research.Web.Controllers" }); //login page for checkout as guest routes.MapLocalizedRoute("LoginCheckoutAsGuest", "login/checkoutasguest", new { controller = "Customer", action = "Login", checkoutAsGuest = true }, new[] { "Research.Web.Controllers" }); //register result page routes.MapLocalizedRoute("RegisterResult", "registerresult/{resultId}", new { controller = "Customer", action = "RegisterResult" }, new { resultId = @"\d+" }, new[] { "Research.Web.Controllers" }); //check username availability routes.MapLocalizedRoute("CheckUsernameAvailability", "customer/checkusernameavailability", new { controller = "Customer", action = "CheckUsernameAvailability" }, new[] { "Research.Web.Controllers" }); //passwordrecovery routes.MapLocalizedRoute("PasswordRecovery", "passwordrecovery", new { controller = "Customer", action = "PasswordRecovery" }, new[] { "Research.Web.Controllers" }); //password recovery confirmation routes.MapLocalizedRoute("PasswordRecoveryConfirm", "passwordrecovery/confirm", new { controller = "Customer", action = "PasswordRecoveryConfirm" }, new[] { "Research.Web.Controllers" }); //topics routes.MapLocalizedRoute("TopicPopup", "t-popup/{SystemName}", new { controller = "Topic", action = "TopicDetailsPopup" }, new[] { "Research.Web.Controllers" }); //blog routes.MapLocalizedRoute("BlogByTag", "blog/tag/{tag}", new { controller = "Blog", action = "BlogByTag" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("BlogByMonth", "blog/month/{month}", new { controller = "Blog", action = "BlogByMonth" }, new[] { "Research.Web.Controllers" }); //blog RSS routes.MapLocalizedRoute("BlogRSS", "blog/rss/{languageId}", new { controller = "Blog", action = "ListRss" }, new { languageId = @"\d+" }, new[] { "Research.Web.Controllers" }); //news RSS routes.MapLocalizedRoute("NewsRSS", "news/rss/{languageId}", new { controller = "News", action = "ListRss" }, new { languageId = @"\d+" }, new[] { "Research.Web.Controllers" }); //set review helpfulness (AJAX link) routes.MapRoute("SetProductReviewHelpfulness", "setproductreviewhelpfulness", new { controller = "Product", action = "SetProductReviewHelpfulness" }, new[] { "Research.Web.Controllers" }); //customer account links routes.MapLocalizedRoute("CustomerReturnRequests", "returnrequest/history", new { controller = "ReturnRequest", action = "CustomerReturnRequests" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CustomerDownloadableProducts", "customer/downloadableproducts", new { controller = "Customer", action = "DownloadableProducts" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CustomerBackInStockSubscriptions", "backinstocksubscriptions/manage", new { controller = "BackInStockSubscription", action = "CustomerSubscriptions" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CustomerBackInStockSubscriptionsPaged", "backinstocksubscriptions/manage/{page}", new { controller = "BackInStockSubscription", action = "CustomerSubscriptions", page = UrlParameter.Optional }, new { page = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CustomerRewardPoints", "rewardpoints/history", new { controller = "Order", action = "CustomerRewardPoints" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CustomerChangePassword", "customer/changepassword", new { controller = "Customer", action = "ChangePassword" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CustomerAvatar", "customer/avatar", new { controller = "Customer", action = "Avatar" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("AccountActivation", "customer/activation", new { controller = "Customer", action = "AccountActivation" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CustomerForumSubscriptions", "boards/forumsubscriptions", new { controller = "Boards", action = "CustomerForumSubscriptions" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CustomerForumSubscriptionsPaged", "boards/forumsubscriptions/{page}", new { controller = "Boards", action = "CustomerForumSubscriptions", page = UrlParameter.Optional }, new { page = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CustomerAddressDelete", "customer/addressdelete/{addressId}", new { controller = "Customer", action = "AddressDelete" }, new { addressId = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CustomerAddressEdit", "customer/addressedit/{addressId}", new { controller = "Customer", action = "AddressEdit" }, new { addressId = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CustomerAddressAdd", "customer/addressadd", new { controller = "Customer", action = "AddressAdd" }, new[] { "Research.Web.Controllers" }); //customer profile page routes.MapLocalizedRoute("CustomerProfile", "profile/{id}", new { controller = "Profile", action = "Index" }, new { id = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("CustomerProfilePaged", "profile/{id}/page/{page}", new { controller = "Profile", action = "Index" }, new { id = @"\d+", page = @"\d+" }, new[] { "Research.Web.Controllers" }); //orders routes.MapLocalizedRoute("OrderDetails", "orderdetails/{orderId}", new { controller = "Order", action = "Details" }, new { orderId = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("ShipmentDetails", "orderdetails/shipment/{shipmentId}", new { controller = "Order", action = "ShipmentDetails" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("ReturnRequest", "returnrequest/{orderId}", new { controller = "ReturnRequest", action = "ReturnRequest" }, new { orderId = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("ReOrder", "reorder/{orderId}", new { controller = "Order", action = "ReOrder" }, new { orderId = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("GetOrderPdfInvoice", "orderdetails/pdf/{orderId}", new { controller = "Order", action = "GetPdfInvoice" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("PrintOrderDetails", "orderdetails/print/{orderId}", new { controller = "Order", action = "PrintOrderDetails" }, new[] { "Research.Web.Controllers" }); //order downloads routes.MapRoute("GetDownload", "download/getdownload/{orderItemId}/{agree}", new { controller = "Download", action = "GetDownload", agree = UrlParameter.Optional }, new { orderItemId = new GuidConstraint(false) }, // orderItemId phải là chuỗi có dạng Guid, ko chấp nhận Guid.Empty new[] { "Research.Web.Controllers" }); routes.MapRoute("GetLicense", "download/getlicense/{orderItemId}/", new { controller = "Download", action = "GetLicense" }, new { orderItemId = new GuidConstraint(false) }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("DownloadUserAgreement", "customer/useragreement/{orderItemId}", new { controller = "Customer", action = "UserAgreement" }, new { orderItemId = new GuidConstraint(false) }, new[] { "Research.Web.Controllers" }); routes.MapRoute("GetOrderNoteFile", "download/ordernotefile/{ordernoteid}", new { controller = "Download", action = "GetOrderNoteFile" }, new { ordernoteid = @"\d+" }, new[] { "Research.Web.Controllers" }); //poll vote AJAX link routes.MapLocalizedRoute("PollVote", "poll/vote", new { controller = "Poll", action = "Vote" }, new[] { "Research.Web.Controllers" }); //comparing products routes.MapLocalizedRoute("RemoveProductFromCompareList", "compareproducts/remove/{productId}", new { controller = "Product", action = "RemoveProductFromCompareList" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("ClearCompareList", "clearcomparelist/", new { controller = "Product", action = "ClearCompareList" }, new[] { "Research.Web.Controllers" }); //recently added products RSS routes.MapLocalizedRoute("RecentlyAddedProductsRSS", "newproducts/rss", new { controller = "Product", action = "RecentlyAddedProductsRss" }, new[] { "Research.Web.Controllers" }); //get state list by country ID (AJAX link) routes.MapRoute("GetStatesByCountryId", "country/getstatesbycountryid/", new { controller = "Country", action = "GetStatesByCountryId" }, new[] { "Research.Web.Controllers" }); //EU Cookie law accept button handler (AJAX link) routes.MapRoute("EuCookieLawAccept", "eucookielawaccept", new { controller = "Common", action = "EuCookieLawAccept" }, new[] { "Research.Web.Controllers" }); //authenticate topic AJAX link routes.MapLocalizedRoute("TopicAuthenticate", "topic/authenticate", new { controller = "Topic", action = "Authenticate" }, new[] { "Research.Web.Controllers" }); //product attributes with "upload file" type routes.MapLocalizedRoute("UploadFileProductAttribute", "uploadfileproductattribute/{attributeId}", new { controller = "ShoppingCart", action = "UploadFileProductAttribute" }, new { attributeId = @"\d+" }, new[] { "Research.Web.Controllers" }); //checkout attributes with "upload file" type routes.MapLocalizedRoute("UploadFileCheckoutAttribute", "uploadfilecheckoutattribute/{attributeId}", new { controller = "ShoppingCart", action = "UploadFileCheckoutAttribute" }, new { attributeId = @"\d+" }, new[] { "Research.Web.Controllers" }); //forums routes.MapLocalizedRoute("ActiveDiscussions", "boards/activediscussions", new { controller = "Boards", action = "ActiveDiscussions" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("ActiveDiscussionsRSS", "boards/activediscussionsrss", new { controller = "Boards", action = "ActiveDiscussionsRSS" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("PostEdit", "boards/postedit/{id}", new { controller = "Boards", action = "PostEdit" }, new { id = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("PostDelete", "boards/postdelete/{id}", new { controller = "Boards", action = "PostDelete" }, new { id = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("PostCreate", "boards/postcreate/{id}", new { controller = "Boards", action = "PostCreate" }, new { id = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("PostCreateQuote", "boards/postcreate/{id}/{quote}", new { controller = "Boards", action = "PostCreate" }, new { id = @"\d+", quote = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("TopicEdit", "boards/topicedit/{id}", new { controller = "Boards", action = "TopicEdit" }, new { id = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("TopicDelete", "boards/topicdelete/{id}", new { controller = "Boards", action = "TopicDelete" }, new { id = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("TopicCreate", "boards/topiccreate/{id}", new { controller = "Boards", action = "TopicCreate" }, new { id = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("TopicMove", "boards/topicmove/{id}", new { controller = "Boards", action = "TopicMove" }, new { id = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("TopicWatch", "boards/topicwatch/{id}", new { controller = "Boards", action = "TopicWatch" }, new { id = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("TopicSlug", "boards/topic/{id}/{slug}", new { controller = "Boards", action = "Topic", slug = UrlParameter.Optional }, new { id = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("TopicSlugPaged", "boards/topic/{id}/{slug}/page/{page}", new { controller = "Boards", action = "Topic", slug = UrlParameter.Optional, page = UrlParameter.Optional }, new { id = @"\d+", page = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("ForumWatch", "boards/forumwatch/{id}", new { controller = "Boards", action = "ForumWatch" }, new { id = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("ForumRSS", "boards/forumrss/{id}", new { controller = "Boards", action = "ForumRSS" }, new { id = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("ForumSlug", "boards/forum/{id}/{slug}", new { controller = "Boards", action = "Forum", slug = UrlParameter.Optional }, new { id = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("ForumSlugPaged", "boards/forum/{id}/{slug}/page/{page}", new { controller = "Boards", action = "Forum", slug = UrlParameter.Optional, page = UrlParameter.Optional }, new { id = @"\d+", page = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("ForumGroupSlug", "boards/forumgroup/{id}/{slug}", new { controller = "Boards", action = "ForumGroup", slug = UrlParameter.Optional }, new { id = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("Search", "boards/search", new { controller = "Boards", action = "Search" }, new[] { "Research.Web.Controllers" }); //private messages routes.MapLocalizedRoute("PrivateMessages", "privatemessages/{tab}", new { controller = "PrivateMessages", action = "Index", tab = UrlParameter.Optional }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("PrivateMessagesPaged", "privatemessages/{tab}/page/{page}", new { controller = "PrivateMessages", action = "Index", tab = UrlParameter.Optional }, new { page = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("PrivateMessagesInbox", "inboxupdate", new { controller = "PrivateMessages", action = "InboxUpdate" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("PrivateMessagesSent", "sentupdate", new { controller = "PrivateMessages", action = "SentUpdate" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("SendPM", "sendpm/{toCustomerId}", new { controller = "PrivateMessages", action = "SendPM" }, new { toCustomerId = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("SendPMReply", "sendpm/{toCustomerId}/{replyToMessageId}", new { controller = "PrivateMessages", action = "SendPM" }, new { toCustomerId = @"\d+", replyToMessageId = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("ViewPM", "viewpm/{privateMessageId}", new { controller = "PrivateMessages", action = "ViewPM" }, new { privateMessageId = @"\d+" }, new[] { "Research.Web.Controllers" }); routes.MapLocalizedRoute("DeletePM", "deletepm/{privateMessageId}", new { controller = "PrivateMessages", action = "DeletePM" }, new { privateMessageId = @"\d+" }, new[] { "Research.Web.Controllers" }); //activate newsletters routes.MapLocalizedRoute("NewsletterActivation", "newsletter/subscriptionactivation/{token}/{active}", new { controller = "Newsletter", action = "SubscriptionActivation" }, new { token = new GuidConstraint(false) }, new[] { "Research.Web.Controllers" }); //robots.txt routes.MapRoute("robots.txt", "robots.txt", new { controller = "Common", action = "RobotsTextFile" }, new[] { "Research.Web.Controllers" }); //sitemap (XML) routes.MapLocalizedRoute("sitemap.xml", "sitemap.xml", new { controller = "Common", action = "SitemapXml" }, new[] { "Research.Web.Controllers" }); //store closed routes.MapLocalizedRoute("StoreClosed", "storeclosed", new { controller = "Common", action = "StoreClosed" }, new[] { "Research.Web.Controllers" }); //install routes.MapRoute("Installation", "install", new { controller = "Install", action = "Index" }, new[] { "Research.Web.Controllers" }); //page not found routes.MapLocalizedRoute("PageNotFound", "page-not-found", new { controller = "Common", action = "PageNotFound" }, new[] { "Research.Web.Controllers" }); }
private void UpdateRoute(RouteCollection routes, string routeName, string url, string controllerName, string actionName, string namespaces) { var route = routes[routeName] as LocalizedRoute; if (route != null) { routes.Remove(route); } routes.MapLocalizedRoute(routeName, url, new { controller = controllerName, action = actionName }, new[] { namespaces }); }