Advertisement
gyrospring

✒ 0007.0042 VS2019 VB MVC Razor RouteConfig.vb

Apr 21st, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. Public Module RouteConfig
  2.  
  3.  
  4.  
  5.  
  6. Public Sub RegisterRoutes(ByVal routes As RouteCollection)
  7.  
  8.  
  9. routes.IgnoreRoute("{resource}.axd/{*pathInfo}")
  10.  
  11. routes.MapRoute(
  12. "Machines",
  13. "machines/{Id}/{*Path}",
  14. New With {.controller = "Machines", .action = "Index", .Id = UrlParameter.Optional}
  15. )
  16.  
  17. routes.MapRoute(
  18. name:="Home",
  19. url:="{Id}/{*Path}",
  20. defaults:=New With {.controller = "Home", .action = "Index", .Id = UrlParameter.Optional}
  21. )
  22.  
  23.  
  24. End Sub
  25.  
  26.  
  27.  
  28.  
  29. End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement