title: AJAX Call not hitting Controller Method - ASP.NET MVC
body: <p>I've tries setting breakpoints at the Controller method. But it does not stop there. The alerts "clicked" and the next one work perfectly fine. But the controller method is not called. Any help is appreciated. Here's my ajax call and my controller method.</p>
  
  <pre><code>var Url = "@Url.Action("~/Home/Get_Location")";
  
  $("#gotoloc").click(function() {
    alert("clicked");
    alert(lat +" "+ lon);
    $.ajax({
      type: "POST",
      url: Url,
      data: { 
        latitude: lat, 
        longitude: lon    
      },
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      success: function(response) {
        alert("Hello:" + response)
      },
      failure: function(response) {
        alert(response.responseText);
      },
      error: function(response) {
        alert(response.responseText);
      }
    });
    alert("ignored");
  });
  </code></pre>
  
  <pre class="lang-csharp prettyprint-override"><code>public JsonResult Get_Location(double latitude,double longitude)
  {
    string loc = latitude + "/" + longitude;
    return Json(loc, JsonRequestBehavior.AllowGet);
  }
  </code></pre>