title: jQuery Ajax with ASP.NET MVC Action: Passing arguments from JavaScript in POST
body: <p>I have an ASP.NET MVC controller action with the following VB.NET signature:</p>
  
  <pre><code>&lt;HttpPost()&gt;
  Public Function ClosestCities
     (ByVal position As MapCoordinate, ByVal citiesCount As UInteger) As JsonResult
  </code></pre>
  
  <p>The <code>MapCordinate</code> class is:</p>
  
  <pre><code>Public Class MapCoordinate
      Public Latitude As Double
      Public Longitude As Double
  End Class
  </code></pre>
  
  <p>If I'm trying to send an Ajax POST in jQuery to the <code>ClosestCities</code> action, what should my request look like?</p>
  
  <p>When I use the following code to POST to this action, in the debugger window of VS, <code>position.longitiude</code> and <code>position.latitude</code> are equal to <code>0.0</code> (<code>0D</code>):</p>
  
  <pre><code>$.post("/geodata/closest-cities", { 
      position: {
          Longitude: mapPosition.lng(),
          Latitude: mapPosition.lat()
      },
      citiesCount: 5
  }, function (cities) {
      debugger;
  });
  </code></pre>