title: Combining conventional routing and attribute routing in asp.net core
body: <p>I've tried to combine conventional and attribute routing together. </p>
  
  <p>However it doesn't work as expected, probably because I've missed to do something.</p>
  
  <p>What I have so far:</p>
  
  <p>Routing:</p>
  
  <pre><code>builder.MapRoute("Default", "{controller=Home}/{action=Index}/{id?}");
  </code></pre>
  
  <p>Home Controller:</p>
  
  <pre><code>public class HomeController : Controller
  {
      public IActionResult Index()
      {
          return View();
      }
  }
  </code></pre>
  
  <p>Attribute Mapped Controller:</p>
  
  <pre><code>[Route("Admin")]
  public class AdminLockController : Controller
  {
      [Route("ControlCenter")]
      public async Task&lt;IActionResult&gt; Index()
      {
          return View();
      }
  }
  </code></pre>
  
  <p>_Layout.cshtml</p>
  
  <pre><code>&lt;a asp-controller="Home" asp-action="Index"&gt;
  &lt;img id="app-logo-image" src="/img/corporate_logo.png"/&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>Now when when the view Home\Index.cshtml get rendered the link in _Layout.cshtml will become 
  <code>&lt;a href="/"&gt;&lt;/a&gt;</code> (Correct).</p>
  
  <p>But when the view AdminLock\Index.cshtml get rendere the link is <code>&lt;a href=""&gt;&lt;/a&gt;</code> (Wrong).</p>
  
  <p>So I guess I need to do some extra configuration, but no idea what. Any hints?</p>
  
  <p><strong>UPDATE 1:</strong>
  It works perfectly in a new created mvc project. So it has to be something wrong in my project... i will try to find out what the issue is... </p>