title: ajax post call not refreshing my controller view in mvc
body: <p>I have a javascript function that sets two values (longitude/latitude) and tries to post back to my action method in the controller. My action method gets hit and I step through the function and then the view into the html, but my page never gets refreshed with the new view that the controller is calling. The latitude and longitude are being passed to my controller greate, it's just not refreshing the view. Any reason why?</p>
  
  <pre><code>function editLocation() {
  
      var place = autocomplete.getPlace();
      var name = place.name;
      var lat = place.geometry.location.lat();
      var lon = place.geometry.location.lng();
      //alert("This function is working!");
      //alert(place.name);
     //alert(place.address_components[0].long_name);
      var requestData = {
          lati: lat,
          longi: lon
      };
  
      $.ajax({
          url: '/Home/Results',
          type: 'POST',
          data: requestData,
          dataType: 'json'
      });
  }
  </code></pre>
  
  <p>Here is the form that had the original get call that I have partially commented out.</p>
  
  <pre><code> @*@using (Html.BeginForm("Results", "Home", FormMethod.Get))
  {*@
      &lt;p&gt;
          &lt;input type="text" name="location" id="location" placeholder="Search For Classes" /&gt;
      &lt;/p&gt;
      &lt;p&gt;
          &lt;input class="btn btn-primary btn-lg" value='Submit' type="submit" onclick="editLocation();" /&gt;
      &lt;/p&gt;
  @*}*@
  </code></pre>
  
  <p>Here is my controller.</p>
  
  <pre><code> public ActionResult Results(string location, string lati, string longi)
      {
          var repo = new YogaSpaceRepository();
  
              /// 1000 Ocean Ave
              DbGeography myLocation = DbGeography.FromText("POINT(-122.453164 37.723057)");
              IQueryable&lt;YogaSpace&gt; spaces = repo.AllWithinDistance(myLocation);
  
  
          return View(spaces);
      }
  </code></pre>
  
  <p>Question - would it be easier to just use hidden variables in my form to pass the longitude/latitude data to my controller? It seems so but not sure if this is the suggested practice.</p>