From 2ea5c23a4dab3dc7126c4d5df6e8c7b2209ee418 Mon Sep 17 00:00:00 2001 From: Jason Zhu Date: Tue, 23 Nov 2021 11:59:50 +1100 Subject: [PATCH] 15.5 Using Static URL Segments; Listing 15-12. A URL Pattern with a Mixed Segment in the RouteConfig.cs File --- UrlsAndRoutes/UrlsAndRoutes/App_Start/RouteConfig.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/UrlsAndRoutes/UrlsAndRoutes/App_Start/RouteConfig.cs b/UrlsAndRoutes/UrlsAndRoutes/App_Start/RouteConfig.cs index 366214d..82428c7 100644 --- a/UrlsAndRoutes/UrlsAndRoutes/App_Start/RouteConfig.cs +++ b/UrlsAndRoutes/UrlsAndRoutes/App_Start/RouteConfig.cs @@ -11,6 +11,8 @@ namespace UrlsAndRoutes { public static void RegisterRoutes(RouteCollection routes) { + routes.MapRoute("", "X{controller}/{action}"); + routes.MapRoute("MyRoute", "{controller}/{action}", new { controller = "Home", action = "Index" });