title: ActionLink and Url.Action target different locations when area attribute is specified in Asp.net MVC 4
body: <p>In _LoggedInUser.cshtml (which is in Views/Shared folder at application's root) view I want to call the Logout method of AC controller. I have two options here: </p>
  
  <p>Using ActionLink</p>
  
  <pre><code>@Html.ActionLink("Logout", "Logout", "AC", new { area = string.Empty })
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>&lt;a href="@Url.Action("Logout", "AC", new { area = string.Empty })"&gt;Logout&lt;/a&gt;
  </code></pre>
  
  <p>I am specifying area because I want to call action method of AC controller irrespective of area it is in.</p>
  
  <p>As far as I understand the difference between @Html.ActionLink() and @Url.action is that first generates an anchor tag where as second returns a url (Please correct me if I am wrong), so I guess both should target to same location but here @Html.ActionLink has following link location:</p>
  
  <pre><code>http://localhost:13974/Home/logout?Length=2
  </code></pre>
  
  <p>whereas <code>&lt;a href="@Url.Action(</code>....  has following link location:</p>
  
  <pre><code>http://localhost:13974/AC/Logout
  </code></pre>
  
  <p>Both links are working fine when area attribute is removed but @Html.ActionLink() breaks when I specify the area</p>
  
  <p>Why both the links are targeting to different locations when I specify area? </p>