title: Url.Action in asp.net core
body: <p>I like the new tag helpers attributes which make readable dynamic html contents. I can create a link by using the asp-controller and asp-action attributes like this:</p>
  
  <pre><code>&lt;a asp-controller="Home" asp-action="Index"&gt;Index&lt;/a&gt;
  </code></pre>
  
  <p>The problem is that there are cases where I need just the URL of the action in order to use it my javascript. For example in order to make an ajax call in ASP.NET MVC 5, I could have the following code:</p>
  
  <pre><code>$.ajax({
      type: "POST",
      url: '@Url.Action("GetData","Ajax")',
      data: "{ }",
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      success: function (data) {
      }
  });
  </code></pre>
  
  <p>I tried to find an equivalent method in ASP.NET Core but I was not able to find one so I have to create the URL myself. Is there a way to get the Action and Razor Page URL in ASP.NET Core.</p>