Nopcommerce Developer's Guide (v): How do I register a new route?

Source: Internet
Author: User
Tags nopcommerce

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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.