code block
The adminarearegistration routing configuration in area is as follows:
public override void Registerarea (AreaRegistrationContext context)
{context
. Maproute (
"Common_default",
"Admin/{controller}/{action}/{id}",
new {controller = "Login", action = " Index ", id = urlparameter.optional},
new string[] {" Root.Areas.Common.Controllers "}
);
}
RouteConfig.cs routing configuration in projects
public static void RegisterRoutes (RouteCollection routes)
{
routes. Ignoreroute ("{resource}.axd/{*pathinfo}");
Routes. Maproute (
"Default",
"{controller}/{action}/{id}",
new {controller = "Login", action = "Index", id = Urlparameter.optional},//This will be the same as the default Controller and action under Admin
new[] {"Root.Areas.Common.Controllers"}// This is the namespace where the default page controller is set
. Datatokens.add ("area", "Common"); (Common is areas the next level name)
}
Configuration Complete!