From 34fae4330ef6bb5601832f8ca41b7da4397d0ca7 Mon Sep 17 00:00:00 2001 From: Scott Addie Date: Fri, 24 Feb 2017 13:21:37 -0600 Subject: [PATCH] Fix area routes code sample (#2820) --- aspnetcore/mvc/controllers/areas.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnetcore/mvc/controllers/areas.md b/aspnetcore/mvc/controllers/areas.md index ff22b7bd0e..bb77a61b7d 100644 --- a/aspnetcore/mvc/controllers/areas.md +++ b/aspnetcore/mvc/controllers/areas.md @@ -124,7 +124,7 @@ Once you've defined the folder hierarchy, you need to tell MVC that each control } ``` -Set up a route definition that works with your newly created areas. The [🔧 Routing to Controller Actions](routing.md) article goes into detail about how to create route definitions, including using conventional routes versus attribute routes. In this example, we'll use a conventional route. To do so, open the *Startup.cs* file and modify it by adding the highlighted route definition below. +Set up a route definition that works with your newly created areas. The [🔧 Routing to Controller Actions](routing.md) article goes into detail about how to create route definitions, including using conventional routes versus attribute routes. In this example, we'll use a conventional route. To do so, open the *Startup.cs* file and modify it by adding the `areaRoute` named route definition below. @@ -137,7 +137,7 @@ Set up a route definition that works with your newly created areas. The [🔧 Ro routes.MapRoute( name: "default", - template: "{controller=Home}/{action=Index}"); + template: "{controller=Home}/{action=Index}/{id?}"); }); ```