Pages - Menu

nopCommerce - Register route for admin controller

In nopCommerce, if you ever create a new or customize a controller in admin and getting 404 not found error? Read on...

With the approach of inheritance of customized controller, it is essential to register a new route for the new controller.

As a developer, it is natural to look at the RouteProvider.cs in the Admin project.



The original Nop Code looks like this which seems promising, but it doesn't do it.



The actual place to look at is hinted by the first image. The correct place to look at should be the Nop.Admin.AdminAreaRegistration.cs.


You can add your routes in here. In my example, it is registering a route for PictureController.


No comments:

Post a Comment