Tushar Tushar - 1 year ago 179
C# Question

Nopcommerce Error- "Page not Found" while redirecting from admin to plugin pages

I am using nopCommerce. I am making plugin Project.

When i tried to redirect Admin page to plugin page,
It gives error like "PAGE NOT FOUND".

My Plugin page url is


But it works properly for this url



public partial class RouteProvider : IRouteProvider
public void RegisterRoutes(RouteCollection routes)
new { controller = "Category", action = "List" },
new[] { "Nop.Plugin.Category.ShopByCategory.Controllers" });
public int Priority
get { return 0; }

I need to implement this by this url localhost:2276/Admin/Category/List.
Is there different way to implement this?

Thank you in advance

Answer Source

If we want to use admin token in URL,we need to add a data token to route.
Here is a code sample how to do this in the RegisterRoutes method of RouteProvider class.

var route = routes.MapRoute(RouteName,
                  new { controller = "ControllerName", action = "ActionName" },
                  new[] { TheNamespaceOfControllerClass }

route.DataTokens.Add("area", "admin");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download