looks like the most interesting bits in the nopcommerce source code. the default route is registered as
routes.MapLocalizedRoute("HomePage", "", new { controller = "Home", action = "Index"}, new[] { "Nop.Web.Controllers" });
basically you want to register your default route first, before the comment //register custom routes . should look like this:
public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Catalog", action = "Category", id = 6 }, new[] { "Nop.Web.Controllers" } ); routes.MapRoute( "CustomHome", // Route name "", // URL with parameters new { controller = "Catalog", action = "Category", id = 6 }, new[] { "Nop.Web.Controllers" } ); //register custom routes (plugins, etc) var routePublisher = EngineContext.Current.Resolve<IRoutePublisher>(); routePublisher.RegisterRoutes(routes); }
the first route may not even be needed. I'm not sure. never worked with nopcommerce.
nathan gonzalez Dec 12 '11 at 6:10 2011-12-12 06:10
source share