title: Ajax call to call a Controller give 404 error
body: <p>I am using Ajax call to call a Controller method but I am getting this error:
  <a href="http://localhost:55942/%22GetCalculateAmortizationSchedule%22,%20%22Home%22" rel="nofollow noreferrer">http://localhost:55942/%22GetCalculateAmortizationSchedule%22,%20%22Home%22</a> 404 (Not Found)</p>
  
  <p>This is my Controller method:</p>
  
  <pre><code>    [HttpPost]
      public ActionResult GetCalculateAmortizationSchedule()
      {
          var data = ......
          var httpClient = new HttpClient();
          var response = httpClient.PostAsJsonAsync("http://localhost:62815/v1/APR/CalculateAmortizationSchedule", data).Result;
          var returnValue = response.Content.ReadAsAsync&lt;Dictionary&lt;int, AmItem&gt;&gt;().Result;
          return Content(returnValue.ToString());
      }
  </code></pre>
  
  <p>This is the View code:</p>
  
  <pre><code> &lt;form id="MyForm" method="post"&gt;
    ....
     &lt;input type="submit" id="test" value="test" /&gt;
     &lt;/form&gt;
  </code></pre>
  
  <p>and this is the Ajax code:</p>
  
  <pre><code>$('#MyForm').submit(function (e) {
  
          $.ajax({
              url: '@Url.Action("GetCalculateAmortizationSchedule", "Home")',
              type: "POST",
              dataType: "json",
              contentType: "application/json; charset=utf-8",
  
              contentType: false,
              processData: false,
              success: function (result) {
                  alert("success");
                  console.log(result.data);
                  // here in result you will get your data
              },
              error: function (result) {
  
              }
          });
          e.preventDefault();
      });
  </code></pre>
  
  <p>I think problem is this line that cannot find the url:</p>
  
  <pre><code>url: '@Url.Action("GetCalculateAmortizationSchedule", "Home")',
  </code></pre>