AspNetCore.Docs/aspnet/whitepapers/add-mobile-pages-to-your-as.../samples/sample8.cs

10 lines
373 B
C#

public override void RegisterArea(AreaRegistrationContext context)
{
// By default there is no "controller" parameter in the following line.
// Add one referencing "Home" as shown.
context.MapRoute(
"Mobile_default",
"Mobile/{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}