title: Virtual areas and links generated by MVC's helper methods
body: <p>I'm trying to organize an MVC web application so that when the user browses to the root of the website, the login form is being shown.</p>
  
  <p>Once the user successfully logs in, a dropdown is shown allowing the user to select in which "Project" they want to work in.</p>
  
  <p>For example, the user selects "My Project" (ID: 100) and after submitting the choice, the browser is redirected to <code>http://website/100/Home/Index</code></p>
  
  <p>I later be using filters to see if the logged in user has access to project <code>100</code></p>
  
  <p>I managed to get this working with those routes:</p>
  
  <pre><code>//what happens when someone requests the root, /
  routes.MapRoute(
      name: "LoginPage",
      url: "",
      defaults: new { controller = "Account", action = "Login" }
  );
  
  //What happens when some browses to /projectid (ie: http://website/100)
  routes.MapRoute(
      name: "HomePage",
      url: "{projectid}",
      defaults: new { controller = "Home", action = "Index" }
  );
  
  //What happens when a client requests http://website/100/mystuff
  routes.MapRoute(
      name: "AllDefault",
      url: "{projectid}/{controller}/{action}",
      defaults: new { controller = "{*.*}", action = "Index" }
  );
  
  //What happens when a client requests an explicit controller/method (ex: http://site/100/mystuff/showit)
  routes.MapRoute(
      name: "All",
      url: "{projectid}/{controller}/{action}",
      defaults: new { controller = "{*.*}", action = "{*.*}" }
  );
  </code></pre>
  
  <p>I see that <code>Html.ActionLink</code> properly appends the controller and method name after the project ID (100).</p>
  
  <p>All links generated in <code>_Layout.cshtml</code> using <code>Html.ActionLink</code> are properly linking to <code>&lt;selected project id&gt;/controller/method</code></p>
  
  <p>The issue, is that sometimes in the views or even in the layout, some controllers and their methods have nothing to do with <code>projects</code> per se. They are sections of the website pertaining to general configurations and such.</p>
  
  <p>Is there a way to create an override for <code>Html.ActionLink</code> to control its default behaviour ?</p>
  
  <p>Also, if you roughly see what I'm trying to do and have better suggestions, shoot. :P</p>