15.5 Using Static URL Segments; Listing 15-13. Mixing Static URL Segments and Default Values in the RouteConfig.cs File

chap15
Jason Zhu 2021-11-23 20:34:18 +11:00
parent 2ea5c23a4d
commit 7e57cd2d16
1 changed files with 3 additions and 0 deletions

View File

@ -11,6 +11,9 @@ namespace UrlsAndRoutes
{ {
public static void RegisterRoutes(RouteCollection routes) public static void RegisterRoutes(RouteCollection routes)
{ {
routes.MapRoute("ShopSchema", "Shop/{action}",
new { controller = "Home" });
routes.MapRoute("", "X{controller}/{action}"); routes.MapRoute("", "X{controller}/{action}");
routes.MapRoute("MyRoute", "{controller}/{action}", routes.MapRoute("MyRoute", "{controller}/{action}",