Guest User

Untitled

a guest
Feb 24th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. localhost:2276/Admin/Category/List
  2.  
  3. localhost:2276/Plugin/Category/List
  4.  
  5. public partial class RouteProvider : IRouteProvider
  6. {
  7. public void RegisterRoutes(RouteCollection routes)
  8. {
  9. routes.MapRoute("Nop.Plugin.Category.ShopByCategory.Views.Category.List",
  10. "Admin/Category/List",
  11. new { controller = "Category", action = "List" },
  12. new[] { "Nop.Plugin.Category.ShopByCategory.Controllers" });
  13. }
  14. public int Priority
  15. {
  16. get { return 0; }
  17. }
  18. }
  19.  
  20. public override void RegisterArea(AreaRegistrationContext context)
  21. {
  22. context.MapRoute(
  23. "Admin_default",
  24. "Admin/{controller}/{action}/{id}",
  25. new { controller = "Home", action = "Index", area = "Admin", id = "" },
  26. new[] { "Nop.Admin.Controllers" }
  27. );
  28. }
  29.  
  30. public partial class RouteProvider : IRouteProvider
  31. {
  32. public void RegisterRoutes(RouteCollection routes)
  33. {
  34. routes.MapRoute("Nop.Plugin.Category.ShopByCategory.Views.Category.List",
  35. "Category/List",
  36. new { controller = "Category", action = "List" },
  37. new[] { "Nop.Plugin.Category.ShopByCategory.Controllers" });
  38. }
  39. public int Priority
  40. {
  41. get { return 0; }
  42. }
  43. }
  44.  
  45. var route = routes.MapRoute(RouteName,
  46. "admin/Plugins/PluginName/ControllerName/ActionName",
  47. new { controller = "ControllerName", action = "ActionName" },
  48. new[] { TheNamespaceOfControllerClass }
  49. );
  50.  
  51. route.DataTokens.Add("area", "admin");
Add Comment
Please, Sign In to add comment