title: ASP.NET Core MVC - Razor - asp-action route issue
body: <p>I am having a small issue with routing when creating a form and setting its route in razor. I have the following in my view:</p>
  <pre><code>&lt;form asp-action=&quot;Create&quot; asp-controller=&quot;Lead&quot;&gt;
  </code></pre>
  <p>However, it POSTs data to my API endpoint (<code>api/lead/create</code>) instead of my standard Controller (<code>lead/create</code>).</p>
  <p>It generates the following HTML:</p>
  <pre><code>&lt;form action=&quot;/api/lead/create&quot; method=&quot;post&quot;&gt;
  </code></pre>
  <p>Any suggestions to how this can be resolved? My controller routes are the default:</p>
  <pre><code>app.UseEndpoints(endpoints =&gt;
  {
      endpoints.MapControllerRoute(
          name: &quot;default&quot;,
          pattern: &quot;{controller=Home}/{action=Index}/{id?}&quot;);
  });
  </code></pre>
  <p>If I completely remove my API method, then it picks the correct route and things work as expected, but I can't seem to have both?</p>
  <p>I am at a loss to this one..</p>
  <p>EDIT:</p>
  <p>This are the Lead Controller definitions:</p>
  <pre><code>// GET: Lead/Create
  public ActionResult Create()
  {
      var viewModel = new CreateOrUpdateLeadViewModel();
  
      return View(viewModel);
  }
  
  // POST: Lead/Create
  [Route(&quot;lead/create&quot;)]
  [HttpPost]
  [ValidateAntiForgeryToken]
  </code></pre>
  <p>And this is the definition for the Lead method on the API Controller:</p>
  <pre><code>[Route(&quot;api/lead/create&quot;, Name = &quot;apileadcreate&quot;)]
  [HttpPost]
  public async Task&lt;IActionResult&gt; Create([FromBody] LeadDto leadDto)
  </code></pre>