title: AJAX Call to MVC5 ActionResult
body: <p>I am trying to figure out what is wrong with the following code:</p>
  
  <pre><code>$(".ReportScore").click(function () {
      $.ajax({
          type: "GET",
          url: "/events/Tournaments/ReportScore",
          success: function() {
              location.reload();
          },
          error: function() {
              alert("The scores were not recorded");
          }
      });
  });
  </code></pre>
  
  <p>When I type the url in the bar, it works without problems, however when I try to do an ajax call I get 404 Page not found error.</p>
  
  <p>To clarify, when I click on the button I Get a popup saying "The scores were not recorded" and on developer tools I get a script error saying Page not found.</p>
  
  <p>I also have a breakpoint in visusal studio on the method itself, but the point is never hit as the method is never called.</p>
  
  <p>Server Side Code:</p>
  
  <pre><code>public async Task&lt;ActionResult&gt; ReportScore()
  {
      var a = "abc"
  }
  </code></pre>
  
  <p>var a line is never hit.</p>
  
  <p>EDIT:</p>
  
  <p>I have another ajax call from the same script that works without problems:</p>
  
  <pre><code>$("#InvitedMember").autocomplete({
      source: function (request, response) {
          $.ajax({
              type: "POST",
              url: "/events/Teams/Members",
              data: { id: $("#InvitedMember").val() },
              success: function (data) {
                  response($.map(data, function (item) {
                      return {
                          label: item.CustomUrl, value: item.CustomUrl
                      };
                  }));
              }
          });
      },
      create: function () {
          $(this).data('ui-autocomplete')._renderItem = function (ul, item) {
              return $('&lt;li&gt;')
                  .append("&lt;a&gt;&lt;div&gt;" + item.label + "&lt;/div&gt;&lt;/a&gt;")
                  .appendTo(ul);
          };
      },
      select: function (event, ui) {
          //you can access ui.item to get the selected item object.
          $("#InvitedMember").val(ui.item.value);
          return false;
      }
  });
  </code></pre>