Original link: http://docs.nopcommerce.com/pages/viewpage.action?pageId=1442547
Translation By:yersans, if there is inappropriate, please correct me, bo main mailbox: [email protected]. Reprint please indicate the source.
The ASP. NET route is responsible for mapping the browse request to a specific MVC controller action. For more information about routing, click here. The Nopcommerce has a
irouteprovider interface that is used to register the route when the program starts. All core routes are registered in the
Routeprovider class under the Nop.web project.
public partial class Routeprovider:irouteprovider {public void RegisterRoutes (routecollection routes) { //home page routes. Maplocalizedroute ("homepage", " ", new {controller = "Home", action = "Index"}, new[] {" Nop.Web.Controllers "});
You can create as many Routeprovider classes as you want. For example, you need to register some custom routes for the plugin, you simply create a new class that implements the Irouteprovider interface, and then register the route for your plugin.
Nopcommerce Developer's Guide (v): How do I register a new route?