asp.net mvc 5 - Routing Not Working inside Area -


i have gone through numerous qa in stack overflow not shut out why happening in application.

dev env.
visual studio 2015
mvc-5

i have create admin area. in admin area registration config routes as

public override void registerarea(arearegistrationcontext context)      {          context.maproute(            "error",            "admin/{action}",            new { controller = "error", action = "notfound" },            namespaces: new[] { "namespace.areas.admin.controllers" }            );          context.maproute(             "admin_default",             "admin/{controller}/{action}/{id}",             new { controller="home",  action = "index", id = urlparameter.optional },             namespaces: new[] { "namespace.areas.admin.controllers" }         );       } 

in above routings error routing error pages (404,500) worked doing resulted admin_default in-effective. whenever try access link in admin_default url format 404.

i did tried attribute routing adding

routes.mapmvcattributeroutes(); //route config file context.routes.mapmvcattributeroutes(); //area route registration file 

but didn't worked either. doing wrong here?

i added mapmvcattributeroutes() @ top before adding maproute


Comments