Hi I am using areas in my asp.net mvc 4 application i have multiple areas and I am navigating from an area to another , How can I remove the area name from the Url like this :
.../AreaName/ControllerName/ActionName To .../ControllerName/ActionName
for example :
"ActionLink("Text","ActionNAme","ControllerName",new{area = "area name"},null)"
sometimes I am redirecting to some view inside other areas after a certain process like the following:
"ReturnRedirectToAction("Text","ActionName","ControllerName",new{area ="areaName"}, null)"
Like this everything works fine but i dont want the AreaName to appear in the Url.
here's an AreaRegistration class:
public class ChileAreaAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "ChileArea";
}
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"ChileArea_default",
"ChileArea/{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional }
);
}
}