title: Relative URL in JQuery Post Call
body: <p>I have the following situation.</p>
  
  <p>I developed my first MVC Asp.Net application.  it runs on my server at the following adress</p>
  
  <pre><code>http://localhost:59441/
  </code></pre>
  
  <p>I wrote some JQuery Post Methods that looked like this</p>
  
  <pre><code>  $.ajax({
          type: "POST",
          url: "/CeduleGlobale/UpdateCheckBox", ...
  </code></pre>
  
  <p>CeduleGlobale is my ControllerName
  and 
  UpdateCheckBox is my methodName</p>
  
  <p>When I put the Application on the testServer, it was put in a VirtualDirectory</p>
  
  <p>hence the application is now</p>
  
  <pre><code>http://testServer/JprApplication/
  </code></pre>
  
  <p>no more port to specify and also an application Name</p>
  
  <p>When I started to test, I quickly noticed my JQuery Post calls didn't work anymore...</p>
  
  <p>I modified them so now the URL is</p>
  
  <pre><code>/JprMvc/CeduleGlobale/UpdateCheckBox
  </code></pre>
  
  <p>the problem is 2 fold.  </p>
  
  <ol>
  <li>this makes it hard to test on my development machine because IIS Express doesn't allow me to specify a virtual Directory.</li>
  <li>I don't like hardCoding the Virtual Directory Name in the JQuery because I dont know what name the Application will have in the production environment and therefore i will have to modify my script before i can install the application in production.</li>
  </ol>
  
  <p>I am sure I am missing some basic thing to simplify this.</p>
  
  <p>Thanks</p>