.net - Mapping an action to area root -
I have an area called Area 1 and I want to map an action in the root of it. For example, I have an action controller (Controller 1) with the main name, which I want to map to www.examplewebsite.com/Area1.
I tried the bottom of area 1AreaRegistration.cs, but it did not work:
Public Override Request Register Area (AreaRegistration Contact Reference) {reference.MapRoute ( "Area1_root", "Area1", new {controller = "Controller1", action = "Main", id = UrlParameter. Optional)); } Is there a way to do this?
Try something like this:
context.MapRoute ( "Area1_root", "Area1 / {action} / {id}", new {action = "main", controller = "controller 1" id = UrlParameter.Optional});
Comments
Post a Comment