public void RegisterRoutes(RouteCollection routes) { var routeCategory = routes.MapRoute( "Nop.Plugin.Affiliate.ProductMapping.LoadUrl", "admin/ProductMapping/LoadUrl", new { controller = "ProductMapping", action = "LoadUrl" }, new[] { "Nop.Plugin.Affiliate.CategoryMap.Controllers" }); routes.Remove(routeCategory); routes.Insert(0, routeCategory); var routeShipping = routes.MapRoute( "Nop.Plugin.Affiliate.ProductMapping.LoadShippingDescription", "ProductMapping/LoadShippingDescription", new { controller = "ProductMapping", action = "LoadShippingDescription" }, new[] { "Nop.Plugin.Affiliate.CategoryMap.Controllers" }); routes.Remove(routeShipping); routes.Insert(0, routeShipping); var routeUpdatePrice = routes.MapRoute( "Nop.Plugin.Affiliate.ProductMapping.UpdatePrice", "admin/ProductMapping/UpdatePrice", new { controller = "ProductMapping", action = "UpdatePrice" }, new[] { "Nop.Plugin.Affiliate.CategoryMap.Controllers" }); routes.Remove(routeUpdatePrice); routes.Insert(0, routeUpdatePrice); }
public void RegisterRoutes(RouteCollection routes) { var route = routes.MapRoute("Plugin.Tameion.Auctions.Public.AuctionsController", "Auctions/{action}/{id}", new { area = "Public", controller = "Auctions", action = "Index", id = UrlParameter.Optional }, new[] { "Nop.Plugin.Tameion.Auctions.Areas.Public.Controllers" } ); routes.Remove(route); routes.Insert(0, route); route = routes.MapRoute("Plugin.Tameion.Auctions.Vendor.AuctionsController", "Vendor/Auctions/{action}/{id}", new { area = "Vendor", controller = "Auctions", action = "Index", id = UrlParameter.Optional }, new[] { "Nop.Plugin.Tameion.Auctions.Areas.Vendor.Controllers" } ); routes.Remove(route); routes.Insert(0, route); route = routes.MapRoute("Plugin.Tameion.Auctions.Admin.AuctionsController", "Admin/Auctions/{action}/{id}", new { area = "Admin", controller = "Auctions", action = "Index", id = UrlParameter.Optional }, new[] { "Nop.Plugin.Tameion.Auctions.Areas.Admin.Controllers" } ); routes.Remove(route); routes.Insert(0, route); ViewEngines.Engines.Insert(0, new CustomViewEngine()); }
public void RegisterRoutes(RouteCollection routes) { ViewEngines.Engines.Insert(0, new PluginViewEngine()); //contact us example var route = routes.MapRoute("ContactUsCustom", "contactus", new { controller = "ContactUs", action = "ContactUs" }, namespaces: new[] { "Nop.Plugins.MyStore.Controllers" } ); routes.Remove(route); routes.Insert(0, route); route = routes.MapRoute("ProductExtendedFields", "Admin/Category/ProductExtendedFields/{productId}", new { controller = "ExtendedFields", action = "ProductExtendedFields" }, new[] { "Nop.Plugins.MyStore.Controllers" } ); route.DataTokens.Add("area", "admin"); routes.Remove(route); routes.Insert(0, route); }
private static void MapRoutes(RouteCollection routes) { var routeBase = routes["CreatePackage"]; routes.Remove(routeBase); routes.Remove(routes["CreatePackage-Root"]); routes.MapDelegate("Override_CreatePackage", "api/v2/package", new { httpMethod = new HttpMethodConstraint("PUT") }, context => CreateSymbolService().CreatePackage(context.HttpContext)); routes.MapDelegate("Override_CreatePackage-Root", "", new { httpMethod = new HttpMethodConstraint("PUT") }, context => CreateSymbolService().CreatePackage(context.HttpContext)); routes.MapDelegate("GetSymbols", "symbols/{*path}", new { httpMethod = new HttpMethodConstraint("GET") }, context => CreateSymbolService().GetSymbols(context)); routes.MapDelegate("GetSource", "source/{id}/{version}/{*path}", new { httpMethod = new HttpMethodConstraint("GET") }, context => CreateSymbolService().GetSource(context)); }
private static void MapRoutes(RouteCollection routes) { var routeBase = routes["CreatePackage"]; routes.Remove(routeBase); routes.Remove(routes["CreatePackage-Root"]); routes.MapDelegate("Override_CreatePackage", "api/v2/package", new { httpMethod = new HttpMethodConstraint("PUT") }, context => CreateSymbolService().CreatePackage(context.HttpContext)); routes.MapDelegate("Override_CreatePackage-Root", "", new { httpMethod = new HttpMethodConstraint("PUT") }, context => CreateSymbolService().CreatePackage(context.HttpContext)); routes.MapDelegate("GetSymbols", "symbols/{*path}", new {httpMethod = new HttpMethodConstraint("GET")}, context =>CreateSymbolService().GetSymbols(context)); routes.MapDelegate("GetSource", "source/{id}/{version}/{*path}", new {httpMethod = new HttpMethodConstraint("GET")}, context => CreateSymbolService().GetSource(context)); }
public void RegisterRoutes(RouteCollection routes) { ViewEngines.Engines.Add(new CustomViewEngine()); var routeArticleGroupAdmin = routes.MapRoute("Plugin.Misc.Articles.ArticleGroup.Admin", "Admin/ArticleGroup/{action}/{id}", new { controller = "ArticleGroup", action = "Index", id = UrlParameter.Optional }, new[] { "Toi.Plugin.Misc.Articles.Controllers" } ); routeArticleGroupAdmin.DataTokens.Add("area", "admin"); routes.Remove(routeArticleGroupAdmin); routes.Insert(0, routeArticleGroupAdmin); var routeArticleAdmin = routes.MapRoute("Plugin.Misc.Articles.Article.Admin", "Admin/Article/{action}/{id}", new { controller = "Article", action = "Index", id = UrlParameter.Optional }, new[] { "Toi.Plugin.Misc.Articles.Controllers" } ); routeArticleAdmin.DataTokens.Add("area", "admin"); routes.Remove(routeArticleAdmin); routes.Insert(0, routeArticleAdmin); //routes.MapRoute("ArticleAdmin", // "Admin/Plugins/ArticleManagement/ArticleAdmin/{action}/{id}", // new { controller = "ArticleAdmin", action = "Index", id = UrlParameter.Optional }, // new[] { "Nop.Plugin.Other.ArticleManagement.Controllers" } // ).DataTokens.Add("area", "admin"); ; }
/// <summary> /// Redirect to localized route if language in not specified. /// </summary> public static void RedirectToLocalizedRoute( RouteCollection routes, bool enable, bool userCurrentCulturLanguage = true, string defaulLanguage = "") { if (enable) { var lng = defaulLanguage; if (string.IsNullOrWhiteSpace(lng)) { lng = _defaultLanguage; } if (_defaultLanguageRedirectToLozalizedRoute != null) { routes.Remove(_defaultLanguageRedirectToLozalizedRoute); } _defaultLanguageRedirectToLozalizedRoute = new RedirectToLozalizedRoute(userCurrentCulturLanguage, lng); routes.Add(RedirectToLocalizedRouteName, _defaultLanguageRedirectToLozalizedRoute); } else { if (_defaultLanguageRedirectToLozalizedRoute != null) { routes.Remove(_defaultLanguageRedirectToLozalizedRoute); } _defaultLanguageRedirectToLozalizedRoute = null; } }
public static void UpdateRoutes(RouteCollection routes) { BrandsMktgBooksEntities db = new BrandsMktgBooksEntities(); var books = db.Books.ToList(); foreach (var book in books) { try { routes.Remove(RouteTable.Routes["ENBook" + book.id.ToString()]); routes.Remove(RouteTable.Routes["FRBook" + book.id.ToString()]); } catch { } try { routes.MapPageRoute("ENBook" + book.id.ToString(), "en/book-" + book.id.ToString(), "~/product.aspx", true, new RouteValueDictionary { { "id", book.id }, { "lang", "en" }, { "levelId", book.levelId }, { "page", "book-" + book.id } }); routes.MapPageRoute("FRBook" + book.id.ToString(), "fr/book-" + book.id.ToString(), "~/product.aspx", true, new RouteValueDictionary { { "id", book.id }, { "lang", "fr" }, { "levelId", book.levelId }, { "page", "book-" + book.id } }); } catch { } } var levels = db.BooksLevels.ToList(); foreach (var level in levels) { try { routes.Remove(RouteTable.Routes["ENLevel" + level.id.ToString()]); routes.Remove(RouteTable.Routes["ARLevel" + level.id.ToString()]); } catch { } try { routes.MapPageRoute("ENLevel" + level.id.ToString(), "en/level-" + level.id.ToString(), "~/books.aspx", true, new RouteValueDictionary { { "id", level.id }, { "lang", "en" }, { "levelId", level.id }, { "page", "level-" + level.id } }); routes.MapPageRoute("FRLevel" + level.id.ToString(), "fr/level-" + level.id.ToString(), "~/books.aspx", true, new RouteValueDictionary { { "id", level.id }, { "lang", "fr" }, { "levelId", level.id }, { "page", "level-" + level.id } }); } catch { } } }
/// <summary> /// Removes the rock page and default routes from RouteTable.Routes but leaves the ones created by ODataService. /// </summary> public static void RemoveRockPageRoutes() { RouteCollection routes = RouteTable.Routes; PageRouteService pageRouteService = new PageRouteService(new Rock.Data.RockContext()); var pageRoutes = pageRouteService.Queryable().ToList(); // First we have to remove the routes stored in the DB without removing the ODataService routes because we can't reload them. // Routes that were removed from the DB have already been removed from the RouteTable in PreSaveChanges() foreach (var pageRoute in pageRoutes) { var route = routes.OfType <Route>().Where(a => a.Url == pageRoute.Route).FirstOrDefault(); if (route != null) { routes.Remove(route); } } // Remove the shortlink route var shortLinkRoute = routes.OfType <Route>().Where(r => r.Url == "{shortlink}").FirstOrDefault(); if (shortLinkRoute != null) { routes.Remove(shortLinkRoute); } // Remove the page route var pageIdRoute = routes.OfType <Route>().Where(r => r.Url == "page/{PageId}").FirstOrDefault(); if (pageIdRoute != null) { routes.Remove(pageIdRoute); } // Remove the default route for when no parameters are passed var defaultRoute = routes.OfType <Route>().Where(r => r.Url == "").FirstOrDefault(); if (defaultRoute != null) { routes.Remove(pageIdRoute); } // Remove scriptmanager ignore route var scriptmanagerRoute = routes.OfType <Route>().Where(r => r.Url == "{resource}.axd/{*pathInfo}").FirstOrDefault(); if (scriptmanagerRoute != null) { routes.Remove(scriptmanagerRoute); } }
private static IContentRoute MapCategoryRoute(this RouteCollection routes, string insertAfterRouteName, string name, string url, object defaults, Func<SiteDefinition, ContentReference> contentRootResolver) { var basePathResolver = ServiceLocator.Current.GetInstance<IBasePathResolver>(); var urlSegmentRouter = ServiceLocator.Current.GetInstance<IUrlSegmentRouter>(); var contentLoader = ServiceLocator.Current.GetInstance<IContentLoader>(); urlSegmentRouter.RootResolver = contentRootResolver; Func<RequestContext, RouteValueDictionary, string> resolver = basePathResolver.Resolve; var contentRouteParameters = new MapContentRouteParameters { UrlSegmentRouter = urlSegmentRouter, BasePathResolver = resolver, Direction = SupportedDirection.Both, Constraints = new { node = new ContentTypeConstraint<CategoryData>(contentLoader) } }; RouteBase mediaRoute = RouteTable.Routes[insertAfterRouteName]; int insertIndex = mediaRoute != null ? RouteTable.Routes.IndexOf(mediaRoute) + 1 : RouteTable.Routes.Count; var route = routes.MapContentRoute(name, url, defaults, contentRouteParameters) as DefaultContentRoute; routes.Remove(route); routes.Insert(insertIndex, route); return route; }
public void Publish(IEnumerable <RouteDescriptor> routes) { var routesArray = routes .OrderByDescending(r => r.Priority) .ToArray(); // this is not called often, but is intended to surface problems before // the actual collection is modified var preloading = new RouteCollection(); foreach (var route in routesArray) { preloading.Add(route.Name, route.Route); } using (_routeCollection.GetWriteLock()) { // existing routes are removed while the collection is briefly inaccessable var cropArray = _routeCollection .OfType <ShellRoute>() .Where(sr => sr.ShellSettingsName == _shellSettings.Name) .ToArray(); foreach (var crop in cropArray) { _routeCollection.Remove(crop); } // new routes are added foreach (var routeDescriptor in routesArray) { var shellRoute = new ShellRoute(routeDescriptor.Route, _shellSettings, _workContextAccessor, _runningShellTable); _routeCollection.Add(routeDescriptor.Name, shellRoute); } } }
/// <summary> /// Changes the default hub route from ~/signalr to a specified url. /// </summary> /// <param name="routes">The route table</param> /// <param name="url">The url of the hubs route. This should *NOT* contain catch-all parameter.</param> /// <param name="resolver">The dependency resolver to use for the hub connection</param> /// <returns>The registered route</returns> public static RouteBase MapHubs(this RouteCollection routes, string url, IDependencyResolver resolver) { resolver.InitializePerformanceCounters(GetInstanceName(), AspNetHandler.AppDomainTokenSource.Token); var existing = routes["signalr.hubs"]; if (existing != null) { routes.Remove(existing); } string routeUrl = url; if (!routeUrl.EndsWith("/")) { routeUrl += "/{*operation}"; } routeUrl = routeUrl.TrimStart('~').TrimStart('/'); var locator = new Lazy <IAssemblyLocator>(() => new AspNetAssemblyLocator()); resolver.Register(typeof(IAssemblyLocator), () => locator.Value); var route = new Route(routeUrl, new HubDispatcherRouteHandler(url, resolver)); route.Constraints = new RouteValueDictionary(); route.Constraints.Add("Incoming", new IncomingOnlyRouteConstraint()); route.Constraints.Add("IgnoreJs", new IgnoreJsRouteConstraint()); routes.Add("signalr.hubs", route); return(route); }
/// <summary> /// Changes the default hub route from ~/signalr to a specified path. /// </summary> /// <param name="routes">The route table</param> /// <param name="url">The path of the hubs route. This should *NOT* contain catch-all parameter.</param> /// <param name="resolver">The dependency resolver to use for the hub connection</param> /// <returns>The registered route</returns> public static RouteBase MapHubs(this RouteCollection routes, string url, IDependencyResolver resolver) { if (routes == null) { throw new ArgumentNullException("routes"); } if (url == null) { throw new ArgumentNullException("url"); } if (resolver == null) { throw new ArgumentNullException("resolver"); } var existing = routes["signalr.hubs"]; if (existing != null) { routes.Remove(existing); } var routeUrl = url.TrimStart('~').TrimStart('/'); var locator = new Lazy <IAssemblyLocator>(() => new BuildManagerAssemblyLocator()); resolver.Register(typeof(IAssemblyLocator), () => locator.Value); return(routes.MapOwinRoute("signalr.hubs", routeUrl, map => map.MapHubs(resolver))); }
public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( name: "Templates", url: "{feature}/templates/{name}", defaults: new { controller = "Template", action = "Render" } ); routes.MapRoute( name: "Angular", url: "{*url}", defaults: new { controller = "Home", action = "AngularIndex" }, constraints: new { AngularConstraint = new AngularConstraint() } ); // to move help route's position to be after angular route but before default route var helpRoute = routes["HelpPage_Default"]; routes.Remove(helpRoute); routes.Add(helpRoute); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); }
public static void RemoveRouteByName(this RouteCollection routes, string routeName) { if (routes[routeName] != null) { routes.Remove(RouteTable.Routes[routeName]); } }
public void RegisterRoutes(RouteCollection routes) { var routeList = routes.MapRoute( "Nop.Plugin.Worldbuy.StateProvinceWB.List", "admin/StateProvinceWB/List", new { controller = "StateProvinceWB", action = "List" }, new[] { "Nop.Plugin.Worldbuy.StateProvinceWB.Controllers" }); routes.Remove(routeList); routes.Insert(0, routeList); var routeRead = routes.MapRoute( "Nop.Plugin.Worldbuy.StateProvinceWB.Read", "admin/StateProvinceWB/Read", new { controller = "StateProvinceWB", action = "Read" }, new[] { "Nop.Plugin.Worldbuy.StateProvinceWB.Controllers" }); routes.Remove(routeRead); routes.Insert(0, routeRead); var routeUpdate = routes.MapRoute( "Nop.Plugin.Worldbuy.StateProvinceWB.Update", "admin/StateProvinceWB/Update", new { controller = "StateProvinceWB", action = "Update" }, new[] { "Nop.Plugin.Worldbuy.StateProvinceWB.Controllers" }); routes.Remove(routeUpdate); routes.Insert(0, routeUpdate); var routeDelete = routes.MapRoute( "Nop.Plugin.Worldbuy.StateProvinceWB.Delete", "admin/StateProvinceWB/Delete", new { controller = "StateProvinceWB", action = "Delete" }, new[] { "Nop.Plugin.Worldbuy.StateProvinceWB.Controllers" }); routes.Remove(routeDelete); routes.Insert(0, routeDelete); var routeSync = routes.MapRoute( "Nop.Plugin.Worldbuy.StateProvinceWB.ImportFromXlsx", "admin/StateProvinceWB/ImportFromXlsx", new { controller = "StateProvinceWB", action = "ImportFromXlsx" }, new[] { "Nop.Plugin.Worldbuy.StateProvinceWB.Controllers" }); routes.Remove(routeSync); routes.Insert(0, routeSync); }
public static Route MapDefault(this RouteCollection routes) { var route = MapRoute(routes, "default", "{*url}", null, null, null); routes.Remove(route); routes.Insert(0, route); return(route); }
public void IndexForNonExistentAfterRemoval() { var c = new RouteCollection(); var r = new Route(null, null); c.Add("x", r); c.Remove(r); Assert.IsNull(c ["x"]); }
static void InstallRoutes(RouteCollection routes) { var assetRoute = new Route("_instantcss/assets/{*path}", new AssetRouteHandler()); routes.Insert(0, assetRoute); var connectionRoute = routes.MapConnection<ExpressCssConnection>("ExpressCss", "_instantcss/connection/{*operation}"); routes.Remove(connectionRoute); routes.Insert(1, connectionRoute); }
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) { var robotsTxtRoute = RouteTable.Routes["robots.txt"]; routes.Remove(robotsTxtRoute); routes.MapRoute("robots.txt", "robots.txt", new { controller = "RobotsTxt", action = "RobotsTextFile" }, new[] { "Nop.Plugin.Misc.CustomRobotsTxt.Controllers" }); }
protected new void RegisterRoutes(RouteCollection routes, PipelineArgs args) { base.RegisterRoutes(routes, args); routes.Remove(routes["cintel_contact_entity"]); routes.MapHttpRoute("cintel_contact_entity", "sitecore/api/ao/v1/contacts/{contactId}", (object)new { controller = "ExperienceProfileSalesforceContact", action = "Get" }); }
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" }); }
private static void RemoveExisting(RouteCollection routes, params string[] names) { foreach (var name in names) { var r = routes[name]; if (r != null) { routes.Remove(r); } } }
public Route RegisterRoute(IMvcPlugin plugin, string name, string url, object defaults, object constraints, string[] namespaces) { Route r = m_routes.MapRoute(name, url, defaults, constraints, namespaces); m_routes.Remove(r); m_registeredRoutes.Add(new PluginRoute() { Plugin = plugin, Route = r }); return(r); }
public static void RegisterNoAccountRoutes(RouteCollection routes) { RegisterRoutes(routes); // deregister the non SPA MVC route, and replace it with a redirect to Functions Homepage so // the user would get the helpful error. var legacyRoute = routes.OfType <Route>().First(r => r.Url == FunctionController.LegacyNonSpaRouteUrl); routes.Remove(legacyRoute); routes.Add(new Route(FunctionController.LegacyNonSpaRouteUrl, new RedirectRouteHandler("~/#/functions"))); }
//public IAppBuilder _appBuilderService { get; set; } public void RegisterRoutes(RouteCollection routes) { ViewEngines.Engines.Add(new CustomViewEngine()); RouteBase r = routes.MapRoute("DevPartner.Nop.Plugin.Misc.StartedKit.SubscribeToTheNewsletter", "DPStartedKit/SubscribeToTheNewsletter", new { controller = "DPStartedKit", action = "SubscribeToTheNewsletter" }, new[] { "DevPartner.Nop.Plugin.Misc.StartedKit.Controllers" }); routes.Remove(r); routes.Insert(0, r); }
public void RegisterRoutes(RouteCollection routes) { var route = routes.MapRoute("Plugin.Tameion.SelectAndSell.SelectSellController", "Vendor/SelectSell/{action}/{id}", new { area = "Vendor", controller = "SelectSell", action = "Index", id = UrlParameter.Optional }, new[] { "Nop.Plugin.Tameion.SelectAndSell.Controllers" } ); routes.Remove(route); routes.Insert(0, route); //ViewEngines.Engines.Insert(0, new CustomViewEngine()); }
private static Route CreateRoute(RouteCollection routes, string name, string path, object defaults, object constraints) { path = path.TrimStart('/'); var route = routes.MapRoute(name, path, defaults); if (constraints != null) { route.Constraints = new System.Web.Routing.RouteValueDictionary(constraints); } routes.Remove(route); return(route); }
public static Route Map(this RouteCollection routes, string name, string url, object defaults, object constraints, string[] namespaces) { var route = routes.MapRoute(name, url, defaults, constraints, namespaces); route.SetRouteName(name); var normalized = new NormalizeRoute(route); routes.Remove(route); routes.Add(name, normalized); return(route); }
public void RegisterRoutes(RouteCollection routes) { var route = routes.MapRoute("Plugin.Tameion.Jobs.JobsController", "Jobs/{action}/{id}", new { controller = "Jobs", action = "Index", id = UrlParameter.Optional }, new[] { "Nop.Plugin.Tameion.Jobs.Controllers" } ); routes.Remove(route); routes.Insert(0, route); ViewEngines.Engines.Insert(0, new CustomViewEngine()); }
public void RegisterRoutes(RouteCollection routes) { var route = routes.MapRoute("Plugin.Misc.Advertisements.AdvertisementsController", "Admin/Ads/{action}/{id}", new { area = "Admin", controller = "Advertisements", action = "Index", id = UrlParameter.Optional }, new[] { "Nop.Plugin.Misc.Advertisements.Controllers" } ); routes.Remove(route); routes.Insert(0, route); ViewEngines.Engines.Insert(0, new CustomViewEngine()); }
public void RegisterRoutes(RouteCollection routes) { var route = routes.MapRoute("Plugin.Tameion.AffiliateSystem.AffiliatesController", "Affiliates/{action}/{id}", new { area = "Admin", controller = "Affiliates", action = "Index", id = UrlParameter.Optional }, new[] { "Nop.Plugin.Tameion.AffiliateSystem.Controllers" } ); routes.Remove(route); routes.Insert(0, route); ViewEngines.Engines.Insert(0, new CustomViewEngine()); }
/// <summary> /// Changes the default hub route from ~/signalr to a specified path. /// </summary> /// <param name="routes">The route table</param> /// <param name="url">The path of the hubs route. This should *NOT* contain catch-all parameter.</param> /// <param name="resolver">The dependency resolver to use for the hub connection</param> /// <returns>The registered route</returns> public static RouteBase MapHubs(this RouteCollection routes, string url, IDependencyResolver resolver) { var existing = routes["signalr.hubs"]; if (existing != null) { routes.Remove(existing); } var routeUrl = url.TrimStart('~').TrimStart('/'); return(routes.MapOwinRoute("signalr.hubs", routeUrl, map => map.MapHubs(resolver))); }
public static void RegisterRoutes(RouteCollection routes) { //remove existing checkout controller routes.Remove(routes["Checkout"]); //map our extended controller routes.MapRoute( "Checkout", "ac/checkout/{action}", new { controller = "Checkout", action = "Index" }, new[] { "ActiveCommerce.Training.Payment.Controllers" } ); }
public static void RegisterRoutes(RouteCollection routes) { //remove existing cart controller routes.Remove(routes["ShoppingCart"]); //map our extended controller routes.MapRoute( "ShoppingCart", "ac/cart/{action}/{code}/{quantity}", new { controller = "ShoppingCart", code = UrlParameter.Optional, quantity = UrlParameter.Optional }, new[] { "ActiveCommerce.Training.EstimateShipping.Controllers" } ); }
public void RegisterRoutes(RouteCollection routes) { ViewEngines.Engines.Insert(0, new PluginViewEngine()); //contact us example var route = routes.MapRoute("ContactUsCustom","contactus", new { controller = "ContactUs", action = "ContactUs" }, namespaces: new[] { "Nop.Plugins.MyStore.Controllers" } ); routes.Remove(route); routes.Insert(0, route); route = routes.MapRoute("ProductExtendedFields", "Admin/Category/ProductExtendedFields/{productId}", new { controller = "ExtendedFields", action = "ProductExtendedFields" }, new[] { "Nop.Plugins.MyStore.Controllers" } ); route.DataTokens.Add("area", "admin"); routes.Remove(route); routes.Insert(0, route); }
public static void RegisterNoAccountRoutes(RouteCollection routes) { if (routes == null) { throw new ArgumentNullException("routes"); } RegisterRoutes(routes); // deregister the non SPA MVC route, and replace it with a redirect to Functions Homepage so // the user would get the helpful error. var legacyRoute = routes.OfType<Route>().First(r => r.Url == FunctionController.LegacyNonSpaRouteUrl); routes.Remove(legacyRoute); routes.Add(new Route(FunctionController.LegacyNonSpaRouteUrl, new RedirectRouteHandler("~/#/functions"))); }
public void RegisterRoutes(RouteCollection routes) { var route = routes.MapRoute("Plugin.Tameion.SupportTicketSystem.Areas.Admin.TicketsController", "Admin/Tickets/{action}/{id}", new { area = "Admin", controller = "Tickets", action = "Index", id = UrlParameter.Optional }, new[] { "Nop.Plugin.Tameion.SupportTicketSystem.Areas.Admin.Controllers" } ); routes.Remove(route); routes.Insert(0, route); route = routes.MapRoute("Plugin.Tameion.SupportTicketSystem.Areas.Vendor.TicketsController", "Vendor/Tickets/{action}/{id}", new { area = "Vendor", controller = "Tickets", action = "Index", id = UrlParameter.Optional }, new[] { "Nop.Plugin.Tameion.SupportTicketSystem.Areas.Vendor.Controllers" } ); routes.Remove(route); routes.Insert(0, route); route = routes.MapRoute("Plugin.Tameion.SupportTicketSystem.Areas.Admin.RepliesController", "Admin/Replies/{action}/{id}", new { area = "Admin", controller = "Replies", action = "Index", id = UrlParameter.Optional }, new[] { "Nop.Plugin.Tameion.SupportTicketSystem.Areas.Admin.Controllers" } ); routes.Remove(route); routes.Insert(0, route); route = routes.MapRoute("Plugin.Tameion.SupportTicketSystem.Areas.Vendor.RepliesController", "Vendor/Replies/{action}/{id}", new { area = "Vendor", controller = "Replies", action = "Index", id = UrlParameter.Optional }, new[] { "Nop.Plugin.Tameion.SupportTicketSystem.Areas.Vendor.Controllers" } ); routes.Remove(route); routes.Insert(0, route); ViewEngines.Engines.Insert(0, new CustomViewEngine()); }
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) { ViewEngines.Engines.Add(new CustomViewEngine()); var lstRoute = new List<Route>(); lstRoute.Add(routes.MapRoute("Plugin.Misc.DoItYourself.DiyGroup.Admin", "Admin/DiyGroup/{action}/{id}", new { controller = "DiyGroup", action = "Index", id = UrlParameter.Optional }, new[] { "Toi.Plugin.Misc.DoItYourself.Controllers" } )); lstRoute.Add(routes.MapRoute("Plugin.Misc.DiyProjectes.DiyProject.Admin", "Admin/DiyProject/{action}/{id}", new {controller = "DiyProject", action = "Index", id = UrlParameter.Optional}, new[] {"Toi.Plugin.Misc.DoItYourself.Controllers"} )); lstRoute.Add(routes.MapRoute("DiyGroup", "DiyGroup/{action}/{id}", new { controller = "DiyGroupRead", action = "Index", id = UrlParameter.Optional }, new[] { "Toi.Plugin.Misc.DoItYourself.Controllers" } )); lstRoute.Add(routes.MapRoute("Diy", "DIY", new { controller = "DiyGroupRead", action = "Index", id = UrlParameter.Optional }, new[] { "Toi.Plugin.Misc.DoItYourself.Controllers" } )); //lstRoute.Add(routes.MapRoute("DiyGroupNavigation", // "DiyGroupNavigation", // new { controller = "DiyGroup", action = "DiyGroupNavigation", id = UrlParameter.Optional }, // new[] { "Toi.Plugin.Misc.DoItYourself.Controllers" } // )); foreach (var route in lstRoute) { routes.Remove(route); routes.Insert(0, route); } //routes.MapRoute("DiyProjectAdmin", // "Admin/Plugins/DiyProjectManagement/DiyProjectAdmin/{action}/{id}", // new { controller = "DiyProjectAdmin", action = "Index", id = UrlParameter.Optional }, // new[] { "Nop.Plugin.Other.DiyProjectManagement.Controllers" } // ).DataTokens.Add("area", "admin"); ; }
private static void MapRoutes(RouteCollection routes) { // The default route is http://{root}/nuget/Packages var factory = new DataServiceHostFactory(); var serviceRoute = new ServiceRoute("nuget", factory, typeof(Packages)); serviceRoute.Defaults = new RouteValueDictionary { { "serviceType", "odata" } }; serviceRoute.Constraints = new RouteValueDictionary { { "serviceType", "odata" } }; routes.Add("nuget", serviceRoute); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); // For some godforsaken reason, the PublishPackage route (registered by NuGet.Server) causes the { controller, action } => url mapping to always return this route. routes.Remove(routes.OfType<Route>().Single(r => r.DataTokens != null && r.DataTokens.ContainsKey("__RouteName") && (string)r.DataTokens["__RouteName"] == "PublishPackage")); }
public void RegisterRoutes(RouteCollection routes) { ViewEngines.Engines.Add(new CustomViewEngine()); var lstRoute = new List<Route>(); lstRoute.Add(routes.MapRoute("Plugin.Misc.Branches.BranchGroup.Admin", "Admin/BranchGroup/{action}/{id}", new { controller = "BranchGroup", action = "Index", id = UrlParameter.Optional }, new[] { "Toi.Plugin.Misc.Brances.Controllers" } )); lstRoute.Add(routes.MapRoute("Plugin.Misc.Branches.Branch.Admin", "Admin/Branch/{action}/{id}", new {controller = "Branch", action = "Index", id = UrlParameter.Optional}, new[] {"Toi.Plugin.Misc.Brances.Controllers"} )); lstRoute.Add(routes.MapRoute("BranchGroup", "BranchGroup/{action}/{id}", new { controller = "BranchGroupRead", action = "Index", id = UrlParameter.Optional }, new[] { "Toi.Plugin.Misc.Brances.Controllers" } )); //lstRoute.Add(routes.MapRoute("BranchGroupNavigation", // "BranchGroupNavigation", // new { controller = "BranchGroup", action = "BranchGroupNavigation", id = UrlParameter.Optional }, // new[] { "Toi.Plugin.Misc.Brances.Controllers" } // )); foreach (var route in lstRoute) { routes.Remove(route); routes.Insert(0, route); } //routes.MapRoute("BranchAdmin", // "Admin/Plugins/BranchManagement/BranchAdmin/{action}/{id}", // new { controller = "BranchAdmin", action = "Index", id = UrlParameter.Optional }, // new[] { "Nop.Plugin.Other.BranchManagement.Controllers" } // ).DataTokens.Add("area", "admin"); ; }
public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); //调整route顺序 var tempRoutes = new List<RouteBase>(); foreach (var item in routes.Where(r => r.GetType() == typeof(Route))) { var url = (item as Route).Url.Trim('/'); if (url.Split('/')[0].IndexOf("{") >= 0) tempRoutes.Add(item); } routes.MapPageRoute("Report", "report", "~/Content/page/report.aspx"); routes.MapRoute( name: "Resource", url: "Resource/{assemblyName}/{*fileName}", defaults: new { controller = "Resource", action = "Index" }, namespaces: new string[] { "Zephyr.Web.Mvc.Controllers" } ); routes.MapRoute( name: "WebMvcDefault", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }, namespaces: new string[] { "Zephyr.Web.Mvc.Controllers" } ); foreach (var item in tempRoutes) { routes.Remove(item); routes.Add(item); } ModelBinders.Binders.Add(typeof(JObject), new JObjectModelBinder()); //for dynamic model binder }
public void RegisterRoutes(RouteCollection routes) { ViewEngines.Engines.Add(new CustomViewEngine()); var lstRoute = new List<Route>(); lstRoute.Add(routes.MapRoute("Plugin.Misc.Services.Service.Admin", "Admin/Service/{action}/{id}", new {controller = "Service", action = "Index", id = UrlParameter.Optional}, new[] {"Toi.Plugin.Misc.Services.Controllers"} )); lstRoute.Add(routes.MapRoute("Services", "Services", new { controller = "ServiceRead", action = "Index", id = UrlParameter.Optional }, new[] { "Toi.Plugin.Misc.Services.Controllers" } )); foreach (var route in lstRoute) { routes.Remove(route); routes.Insert(0, route); } }
public void RegisterRoutes(RouteCollection routes) { //var route = routes.MapRoute("Plugin.Misc.VendorMembership.VendorMembershipController", // "VendorMembership/{action}/{id}", // new { controller = "VendorMembership", action = "Dashboard", id = UrlParameter.Optional }, // new[] { "Nop.Plugin.Misc.VendorMembership.Controllers" } //); //routes.Remove(route); //routes.Insert(0, route); var route = routes.MapRoute("Plugin.Misc.VendorMembership.Vendor.ProductsController", "Vendor/Products/{action}/{id}", new { area = "Vendor", controller = "Products", action = "Index", id = UrlParameter.Optional }, new[] { "Nop.Plugin.Misc.VendorMembership.Controllers" } ); routes.Remove(route); routes.Insert(0, route); route = routes.MapRoute("Plugin.Misc.VendorMembership.Vendor.OrdersController", "Vendor/Orders/{action}/{id}", new { area = "Vendor", controller = "Orders", action = "Index", id = UrlParameter.Optional }, new[] { "Nop.Plugin.Misc.VendorMembership.Controllers" } ); routes.Remove(route); routes.Insert(0, route); route = routes.MapRoute("Plugin.Misc.VendorMembership.Vendor.AccountController", "Vendor/Account/{action}", new { area = "Vendor", controller = "Account", action = "Index" }, new[] { "Nop.Plugin.Misc.VendorMembership.Controllers" } ); routes.Remove(route); routes.Insert(0, route); route = routes.MapRoute("Plugin.Misc.VendorMembership.Vendor.Dashboard", "Vendor", new { area = "Vendor", controller = "Dashboard", action = "Index" }, new[] { "Nop.Plugin.Misc.VendorMembership.Areas.Vendor.Controllers" } ); routes.Remove(route); routes.Insert(0, route); route = routes.MapRoute("Plugin.Misc.VendorMembership.Vendor.SettingsController", "Vendor/Settings", new { area = "Vendor", controller = "Settings", action = "Index" }, new[] { "Nop.Plugin.Misc.VendorMembership.Controllers" } ); routes.Remove(route); routes.Insert(0, route); route = routes.MapRoute("Plugin.Misc.VendorMembership.Vendor.InvoicesController", "Vendor/Invoices/{action}", new { area = "Vendor", controller = "Invoices", action = "Index" }, new[] { "Nop.Plugin.Misc.VendorMembership.Controllers" } ); routes.Remove(route); routes.Insert(0, route); route = routes.MapRoute("Plugin.Misc.VendorMembership.Admin.MultitenancyController", "Admin/Multitenancy/{action}", new { area = "Admin", controller = "Multitenancy", action = "Settings" }, new[] { "Nop.Plugin.Misc.VendorMembership.Areas.Admin.Controllers" } ); routes.Remove(route); routes.Insert(0, route); route = routes.MapRoute("Plugin.Misc.VendorMembership.Admin.VendorTypesController", "Admin/VendorTypes/{action}", new { area = "Admin", controller = "VendorTypes", action = "Index" }, new[] { "Nop.Plugin.Misc.VendorMembership.Areas.Admin.Controllers" } ); routes.Remove(route); routes.Insert(0, route); route = routes.MapRoute("Plugin.Misc.VendorMembership.Theme.Controllers", "Theme/Home/{action}/{id}", new { area = "Theme", controller = "Home", action = "Index", id = UrlParameter.Optional }, new[] { "Nop.Plugin.Misc.VendorMembership.Areas.Theme.Controllers" } ); routes.Remove(route); routes.Insert(0, route); route = routes.MapRoute("Plugin.Misc.VendorMembership.Theme.Controllers", "Theme", new { area = "Theme", controller = "Home", action = "Index", id = UrlParameter.Optional }, new[] { "Nop.Plugin.Misc.VendorMembership.Areas.Theme.Controllers" } ); routes.Remove(route); routes.Insert(0, route); route = routes.MapRoute("Plugin.Misc.VendorMembership.Areas.Vendor.Controllers.ReturnRequestController", "Vendor/ReturnRequest/{action}", new { area = "Vendor", controller = "ReturnRequest", action = "Index" }, new[] { "Nop.Plugin.Misc.VendorMembership.Areas.Vendor.Controllers" } ); routes.Remove(route); routes.Insert(0, route); route = routes.MapRoute("Plugin.Misc.VendorMembership.Areas.Vendor.Controllers.DashboardController", "Vendor/Dashboard/{action}", new { area = "Vendor", controller = "Dashboard", action = "Index" }, new[] { "Nop.Plugin.Misc.VendorMembership.Areas.Vendor.Controllers" } ); routes.Remove(route); routes.Insert(0, route); ViewEngines.Engines.Insert(0, new CustomViewEngine()); }
public void IndexForNonExistentAfterRemoval () { var c = new RouteCollection (); var r = new Route (null, null); c.Add ("x", r); c.Remove (r); Assert.IsNull(c ["x"]); }
public void RegisterRoutes(RouteCollection routes) { #region Custom View Engine global::System.Web.Mvc.ViewEngines.Engines.Insert(0, new PromoViewEngine()); #endregion #region admin routes var promosProductFeedRoute = routes.MapRoute("Qixol.Promos.GenerateFeed", "Admin/PromosFeed/Admin/Feed/PromosFeed", new { controller = "PromoAdmin", action = "GenerateFeed" }, new[] { "Qixol.Plugin.Misc.Promo.Controllers" } ); promosProductFeedRoute.DataTokens.Add("area", "admin"); var adminDiscountRoute = routes.MapRoute("QixolPromosAdminDiscount", "Admin/Discount/{action}/{id}", new { controller = "AdminDiscount", action = "Index", id = "", area = "PromoAdmin" }, new[] { "Qixol.Plugin.Misc.Promo.Controllers" } ); adminDiscountRoute.DataTokens.Add("area", "admin"); routes.Remove(adminDiscountRoute); routes.Insert(0, adminDiscountRoute); #endregion #region website routes routes.MapRoute("PromoContinueShopping", "checkout/continueshopping", new { controller = "Checkout", action = "ContinueShopping" }, new[] { "Qixol.Plugin.Misc.Promo.Controllers" } ); var promosShoppingCartRoute = routes.MapRoute("PromosShoppingCart", "cart/", new { controller = "ShoppingCart", action = "Cart" }, new[] { "Qixol.Plugin.Misc.Promo.Controllers" } ); routes.Remove(promosShoppingCartRoute); routes.Insert(0, promosShoppingCartRoute); var promosCheckoutRoute = routes.MapRoute("PromoCheckout", "checkout", new { controller = "PromoCheckout", action = "PromoIndex" }, new[] { "Qixol.Plugin.Misc.Promo.Controllers" } ); routes.Remove(promosCheckoutRoute); routes.Insert(0, promosCheckoutRoute); var promosCheckoutShippingMethodRoute = routes.MapRoute("PromoCheckoutShippingMethod", "checkout/shippingmethod", new { controller = "Checkout", action = "ShippingMethod" }, new[] { "Qixol.Plugin.Misc.Promo.Controllers" } ); routes.Remove(promosCheckoutShippingMethodRoute); routes.Insert(0, promosCheckoutShippingMethodRoute); var promosCheckoutOpcSaveShippingRoute = routes.MapRoute("PromoCheckoutOpcSaveShipping", "checkout/OpcSaveShipping", new { controller = "Checkout", action = "OpcSaveShipping" }, new[] { "Qixol.Plugin.Misc.Promo.Controllers" } ); routes.Remove(promosCheckoutOpcSaveShippingRoute); routes.Insert(0, promosCheckoutOpcSaveShippingRoute); var promosCheckoutOnePageRoute = routes.MapRoute("PromoCheckoutOnePage", "onepagecheckout/", new { controller = "Checkout", action = "PromoOnePageCheckout" }, new[] { "Qixol.Plugin.Misc.Promo.Controllers" } ); //routes.Remove(promosCheckoutOnePageRoute); //routes.Insert(0, promosCheckoutOnePageRoute); var missedPromotionsRoute = routes.MapRoute("PromoCheckoutMissedPromotions", "checkout/missedpromotions", new { controller = "PromoCheckout", action = "MissedPromotions" }, new[] { "Qixol.Plugin.Misc.Promo.Controllers" } ); // do NOT remove and reinsert - loses name #endregion }
private void InsertNewMapRoute(RouteCollection routes, string name, string url, string controllerName, string actionName, object routeParams = null, bool isAdmin = true, bool expectsId = false, bool insertAtZeroRoute = true) { object controllerParams = null; if (!expectsId) controllerParams = new { controller = controllerName, action = actionName }; else { controllerParams = new { controller = controllerName, action = actionName, Id = UrlParameter.Optional }; if (routeParams == null) routeParams = new { id = @"\d+" }; } var newMapRoute = routes.MapRoute(name, url, controllerParams, routeParams, new[] { "Qixol.Nop.Controllers" } ); if(isAdmin) newMapRoute.DataTokens.Add("area", "admin"); if (insertAtZeroRoute) { routes.Remove(newMapRoute); routes.Insert(0, newMapRoute); } }
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 }); }
private void InsertRoute(RouteCollection routes, RouteBase route) { routes.Remove(route); routes.Insert(0, route); }
public void RegisterRoutes(RouteCollection routes) { #region Custom View Engine global::System.Web.Mvc.ViewEngines.Engines.Insert(0, new PromoViewEngine()); #endregion // Main Banner List var promoBanner = routes.MapRoute("Qixol.Promos.PromoBanner", "Admin/PromoBanner/Admin/Banner/Index", new { controller = "PromoBanner", action = "Index" }, new[] { "Qixol.Plugin.Widgets.Promo.Controllers" } ); promoBanner.DataTokens.Add("area", "admin"); // For a banner, PICTURES - retrieve / add / edit / delete var promoBannerList = routes.MapRoute("Qixol.Promos.PromoBanner.List", "Admin/PromoBanner/Admin/Banner/List", new { controller = "PromoBanner", action = "BannerPicturesList" }, new[] { "Qixol.Plugin.Widgets.Promo.Controllers" } ); promoBannerList.DataTokens.Add("area", "admin"); var promoBannerAdd = routes.MapRoute("Qixol.Promos.PromoBanner.Add", "Admin/PromoBanner/Admin/Banner/Add", new { controller = "PromoBanner", action = "BannerPictureAdd" }, new[] { "Qixol.Plugin.Widgets.Promo.Controllers" } ); promoBannerAdd.DataTokens.Add("area", "admin"); var promoBannerEdit = routes.MapRoute("Qixol.Promos.PromoBanner.Edit", "Admin/PromoBanner/Admin/Banner/Edit", new { controller = "PromoBanner", action = "BannerPictureEdit" }, new[] { "Qixol.Plugin.Widgets.Promo.Controllers" } ); promoBannerEdit.DataTokens.Add("area", "admin"); var promoBannerDelete = routes.MapRoute("Qixol.Promos.PromoBanner.Delete", "Admin/PromoBanner/Admin/Banner/Delete", new { controller = "PromoBanner", action = "BannerPictureDelete" }, new[] { "Qixol.Plugin.Widgets.Promo.Controllers" } ); promoBannerDelete.DataTokens.Add("area", "admin"); // For a Banner, WIDGET ZONES - retrieve / add / edit / delete var promoBannerWidgetZoneList = routes.MapRoute("Qixol.Promos.PromoBanner.WidgetZoneList", "Admin/PromoBanner/Admin/Banner/WidgetZoneList", new { controller = "PromoBanner", action = "BannerWidgetZonesList" }, new[] { "Qixol.Plugin.Widgets.Promo.Controllers" } ); promoBannerWidgetZoneList.DataTokens.Add("area", "admin"); var promoBannerWidgetZoneAdd = routes.MapRoute("Qixol.Promos.PromoBanner.WidgetZoneAdd", "Admin/PromoBanner/Admin/Banner/AddWidgetZone", new { controller = "PromoBanner", action = "BannerWidgetZoneAdd" }, new[] { "Qixol.Plugin.Widgets.Promo.Controllers" } ); promoBannerWidgetZoneAdd.DataTokens.Add("area", "admin"); var promoBannerWidgetZoneDelete = routes.MapRoute("Qixol.Promos.PromoBanner.WidgetZoneDelete", "Admin/PromoBanner/Admin/Banner/DeleteWidgetZone", new { controller = "PromoBanner", action = "BannerWidgetZoneDelete" }, new[] { "Qixol.Plugin.Widgets.Promo.Controllers" } ); promoBannerWidgetZoneDelete.DataTokens.Add("area", "admin"); var accountIssuedCoupons = routes.MapRoute("CustomerIssuedCoupons", "customer/issuedcoupons", new { controller = "PromoCustomerCoupon", action = "CustomerIssuedCoupons" }, new[] { "Qixol.Plugin.Misc.Wdigets.Controllers" } ); routes.Remove(accountIssuedCoupons); routes.Insert(0, accountIssuedCoupons); }