15.6.3 Defining Variable-Length Routes; Listing 15-23. Designating a Catchall Variable in the RouteConfig.cs File
parent
488ab5bfac
commit
b9dc70e649
|
@ -11,7 +11,7 @@ namespace UrlsAndRoutes
|
||||||
{
|
{
|
||||||
public static void RegisterRoutes(RouteCollection routes)
|
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});
|
new { controller = "Home", action = "Index", id = UrlParameter.Optional});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue