title: jquery how to find the correct url on a Get method I use mvc 4
body: <p>I was basically using Jquery inside my mvc4 razor page and thus I could use url.action like this</p>
  
  <pre><code>$.get('@Url.Action("details","user")'
  </code></pre>
  
  <p>I have now moved my jquery to an external file and I obviously can not user razor helpers to get the correct URL, how can I get that same url from an external js page, I have tried a few new ways and it does not work like this</p>
  
  <pre><code>$.get('~/Controllers/user/details')
   $.get('~/user/details')
  </code></pre>
  
  <p>I would like how to find this without using a global variable, I have seen many websites use it like</p>
  
  <pre><code>$.get('details.html')
  </code></pre>
  
  <p>but since this is mvc that does not work, any help would be great</p>
  
  <p>The routes are standard MVC routes </p>
  
  <pre><code>         routes.MapRoute(
          name: "profile", // Route name
          url: "{controller}/{action}", // URL with parameters
          defaults: new { controller = "profile", action = "detail", id = UrlParameter.Optional }
  
                   );
  </code></pre>