title: jQuery posts data to wrong relative URL
body: <p>I have an ASP.Net MVC application. I am trying to post data to an action, and then just render the output. I have a page where you can view a product, so www.mysite.com/product/details/1 shows the product. On this page, I render a partial view through RenderAction() that contains some pricing logic. I want the user to select some options and then have jquery post the options to get the new price. </p>
  
  <p>However, when I call </p>
  
  <pre><code>$.post({
    url : "price/getprice",
    data : {"options" : chosenOptions},
    success : function(data) {
                $("#price").text(data);
              }
  });
  </code></pre>
  
  <p>The url is posting to <code>www.mysite.com/product/details/price/getprice</code> which doesn't exist. I've tried posting to "~/price/getprice/" but it does the same thing. Why won't it go to my PriceController's GetPrice(FormCollection form) action??</p>
  
  <p>This should post to <code>www.mysite.com/price/getprice</code>. When I look in the Net tab in firebug, it says it's posting this:</p>
  
  <pre><code>http://localhost:42427/Product/Details/%5Bobject%20Object%5D
  </code></pre>
  
  <p>If I look at the response in Firebug, the application is throwing an exception:</p>
  
  <blockquote>
    <p>The parameters dictionary contains a
    null entry for parameter 'id' of
    non-nullable type 'System.Int32' for
    method 'System.Web.Mvc.ActionResult
    Details(Int32)' in
    'PrintPlaceWebsite.Controllers.ProductController'.</p>
  </blockquote>
  
  <p>But I'm not trying to post to that location so...ugh.</p>