title: Calling a controller action using AJAX with an anchor vs a button
body: <p>I have a IActionResult on my controller that returns a Partial View via AJAX:</p>
  
  <pre><code>[HttpGet]
  [Route("/propertycoverages/loss")]
  public IActionResult GetNewLoss()
  {
      return PartialView("_Loss");
  }
  </code></pre>
  
  <p>If I put an <code>&lt;a&gt;</code> tag in my Razor view with the following:</p>
  
  <pre><code>&lt;a asp-controller="PropertyCoverages" asp-action="GetNewLoss" id="loss-btn" data-ajax="true" data-ajax-update="losses" data-ajax-success="addLoss" data-ajax-method="GET"&gt;Add&lt;/a&gt;
  </code></pre>
  
  <p>the following HTML attribute gets generated in the <code>&lt;a&gt;</code> tag: <code>href="/propertycoverages/loss"</code></p>
  
  <p>it works as expected and the partial view is returned within the page. However, if I try to use a button:</p>
  
  <pre><code>&lt;button asp-controller="PropertyCoverages" asp-action="GetNewLoss" id="loss-btn" type="submit" data-ajax="true" data-ajax-update="losses" data-ajax-success="addLoss" data-ajax-method="GET"&gt;Add&lt;/button&gt;
  </code></pre>
  
  <p>the following HTML attribute gets generated in the <code>&lt;button&gt;</code> tag: <code>formaction="/propertycoverages/loss"</code></p>
  
  <p>and I get redirected to <code>/propertycoverages/loss</code> which is not what I want. <strong>Is there a way I can make the button behave like the <code>&lt;a&gt;</code> tag</strong>?</p>
  
  <p>Note: These elements are inside a <code>&lt;form&gt;</code>. I also tried switching the <code>&lt;button&gt;</code> from <code>type="submit"</code> to <code>type="button"</code> but the controller action doesn't get called.</p>