From 981ebcaf479095203c4ae0d9246b65a6ff841c85 Mon Sep 17 00:00:00 2001 From: Jason Zhu Date: Tue, 23 Nov 2021 11:52:55 +1100 Subject: [PATCH] 15.5 Using Static URL Segments; Listing 15-11. A URL Pattern with Static Segments in the RouteConfig.cs File --- UrlsAndRoutes/UrlsAndRoutes/App_Start/RouteConfig.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/UrlsAndRoutes/UrlsAndRoutes/App_Start/RouteConfig.cs b/UrlsAndRoutes/UrlsAndRoutes/App_Start/RouteConfig.cs index a352df3..366214d 100644 --- a/UrlsAndRoutes/UrlsAndRoutes/App_Start/RouteConfig.cs +++ b/UrlsAndRoutes/UrlsAndRoutes/App_Start/RouteConfig.cs @@ -12,7 +12,10 @@ namespace UrlsAndRoutes public static void RegisterRoutes(RouteCollection routes) { routes.MapRoute("MyRoute", "{controller}/{action}", - new { controller = "Home", action = "Index"}); + new { controller = "Home", action = "Index" }); + + routes.MapRoute("", "Public/{controller}/{action}", + new { controller = "Home", action = "Index" }); } } }