From b9dc70e649bf4759fc77a551a3b4c6c767c340ec Mon Sep 17 00:00:00 2001 From: Jason Zhu Date: Wed, 24 Nov 2021 19:11:59 +1100 Subject: [PATCH] 15.6.3 Defining Variable-Length Routes; Listing 15-23. Designating a Catchall Variable in the RouteConfig.cs File --- UrlsAndRoutes/UrlsAndRoutes/App_Start/RouteConfig.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UrlsAndRoutes/UrlsAndRoutes/App_Start/RouteConfig.cs b/UrlsAndRoutes/UrlsAndRoutes/App_Start/RouteConfig.cs index 6fe3aa0..82ba99d 100644 --- a/UrlsAndRoutes/UrlsAndRoutes/App_Start/RouteConfig.cs +++ b/UrlsAndRoutes/UrlsAndRoutes/App_Start/RouteConfig.cs @@ -11,7 +11,7 @@ namespace UrlsAndRoutes { public static void RegisterRoutes(RouteCollection routes) { - routes.MapRoute("MyRoute", "{controller}/{action}/{id}", + routes.MapRoute("MyRoute", "{controller}/{action}/{id}/{*catchall}", new { controller = "Home", action = "Index", id = UrlParameter.Optional}); } }