title: How to link from View in Area to the root controller?
body: <p>I'm new to <code>MVC</code>, still learning ins and outs by converting <code>.NET</code> App to <code>MVC</code>.</p>
  
  <p>I have trouble linking to another <code>Action</code> in my <code>controller</code> from the page inside of the <code>"Area"</code> section.</p>
  
  <p>I created <code>Areas</code> and still have the default route set up.</p>
  
  <p>The <code>Area</code> has the following structure:</p>
  
  <pre><code>Area
    - Admin
      - Controller
          UserController.cs
      -Model
      -Views
          User
             Index.cshtml
  </code></pre>
  
  <p><code>Index.cshtml</code> has a link that should call <code>"Index"</code> action in <code>AccountController</code> to open <code>"Default"</code> view:</p>
  
  <pre><code>&lt;div class="pagenavigator"&gt;@Html.ActionLink("Main Menu", "Index", new { area = "", controller="Account" })&lt;/div&gt;
  </code></pre>
  
  <p>The default structure of the application is the following:</p>
  
  <pre><code>- Controller
       AccountController.cs
  - Views
       - Account
            Default.cshtml 
            Login.cshtml
  </code></pre>
  
  <p>My default structure has also controller folder that has a controller with Login (default) action set in <code>RouteConfig.cs</code>:</p>
  
  <pre><code>routes.MapRoute(
     name: "Default",
     url: "{controller}/{action}/{id}",
     defaults: new { controller = "Account", action = "Login", id = UrlParameter.Optional }
  );
  </code></pre>
  
  <p>Here is <code>Account Controller</code>:</p>
  
  <pre><code>public class AccountController : Controller
  {
      public ActionResult Login(string returnUrl)
      {
          StringBuilder sb = new StringBuilder();
          sb.Append("Web Security Administration Portal&lt;br/&gt;&lt;br/&gt;");
          ViewBag.ReturnUrl = returnUrl;
          ViewBag.Message = sb.ToString();
          return View();
      }
  
      public ActionResult Index()
      {
          return View("Default");
      }
  
      public ActionResult Login(LoginModel model)
      {
          if (ModelState.IsValid)
          {
             bool authenticated = Security.AuthenticateLANUser(model.UserName, model.Password);
             if (!authenticated)
             {
                 Session["authenticated"] = false;
                 System.Text.StringBuilder errorMsg = new System.Text.StringBuilder();
                 errorMsg.Append("Invalid Login/Password entered.");
                 errorMsg.Append("We were not able to authenticate you in in Active Directory based on the information entered, ");
                 errorMsg.Append("but we recorded your attempt for audit purposes.");
  
                 ModelState.AddModelError("", errorMsg.ToString());
                 return View(model);
              }
              else
              {
                  return View("Default");
              }
          }
  
          ModelState.AddModelError("", "The user name or password provided is incorrect.");
          return View(model);
      }
  }
  </code></pre>
  
  <p>What should I do if I need to link to <code>"Default"</code> view defined under default application route, from <code>Index.cshtml</code> defined under <code>Area</code>, so when I click the link, my <code>"AccountController"</code> gets called with the correct <code>"Index"</code> action?</p>
  
  <p>In short, I need to find out the way to link from "Area" section to a controller's action in default application section, so the another correct Action gets called, which is not specified in default route mapping 
  Right now, the link is broken.</p>
  
  <p>When I view the link in the source, I see the following: <code>&lt;a href="/Account/Index"&gt;</code>, but when I click on the link, I'm getting the error saying: The resource cannot be found with Requested URL: <code>/login.aspx</code></p>
  
  <p>Here is AdminAreaRegistration:</p>
  
  <pre><code>    public override void RegisterArea(AreaRegistrationContext context)
      {
          context.MapRoute(
              "Admin_default",
              "Admin/{controller}/{action}/{id}",
              new { action = "Index", id = UrlParameter.Optional }
          );
      }
  </code></pre>