15.5 Using Static URL Segments; Listing 15-11. A URL Pattern with Static Segments in the RouteConfig.cs File
parent
6112f51510
commit
981ebcaf47
|
@ -12,7 +12,10 @@ namespace UrlsAndRoutes
|
||||||
public static void RegisterRoutes(RouteCollection routes)
|
public static void RegisterRoutes(RouteCollection routes)
|
||||||
{
|
{
|
||||||
routes.MapRoute("MyRoute", "{controller}/{action}",
|
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" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue