title: ASP.NET MVC: Always auto link to a default area, unless an area is specified
body: <p>I have an existing application that has no areas. However, I am adding a whole new section so I have a created an area. So I have one area and the default area.</p>
  
  <p>So, for example:</p>
  
  <p>Default route = /Invoice/Create</p>
  
  <p>Area route = /TAE/Port/Create</p>
  
  <p>Both these links work. However, when I navigate to the TAE area section, all the links change to be within that TAE area. eg /TAE/Invoice/Create</p>
  
  <p>I can force them to have no area adding new { area = "" } to the action link, but this involves modifying every link in the application.</p>
  
  <p>Is it possible to have an actionlink with no area specified always go to the default area, regardless of what area the current page is in?</p>
  
  <p>global.asax.cs</p>
  
  <pre><code>    public static void RegisterRoutes(RouteCollection routes)
      {
          routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
          routes.MapRoute(
              "Default",                                              // Route name
              "{controller}/{action}/{id}",                           // URL with parameters
              new { area="", controller = "Home", action = "Index", id = "" }, // Parameter defaults
              new string[] { "BankingDB.Controllers" } //namespaces
          );
  
      }
  </code></pre>
  
  <p>TAEAreaRegistration.cs</p>
  
  <pre><code>    public override void RegisterArea(AreaRegistrationContext context)
      {
          context.MapRoute(
              "TAE_default",
              "TAE/{controller}/{action}/{id}",
              new { action = "Index", id = UrlParameter.Optional }
          );
      }
  </code></pre>
  
  <p>Link to TAE area:</p>
  
  <pre><code>&lt;%= Html.ActionLink("Create", "Create", "Port" , new { area = "TAE"}, new {}) %&gt;
  </code></pre>
  
  <p>Normal area link:</p>
  
  <pre><code>&lt;%= Html.ActionLink("Create", "Create", "Invoice") %&gt;
  </code></pre>