title: Calling an ActionResult in a controller that isn't Home
body: <p>I have a bit of javascript that is trying to POST to an ActionResult in a controller called Tables.  For some reason the routing isn't working.</p>
  
  <p>My Javascript (in script tags at the top of my view):</p>
  
  <pre><code>$(document).ready(function () {
      $('#somevalue').autocomplete({
          source: '@Url.Action("Tables/GetExpenseTypes")'
      });
  })
  </code></pre>
  
  <p>My Controller:</p>
  
  <pre><code>public class TablesController : Controller
  {
      public ActionResult GetExpenseTypes(string term)
      {
          return Json(Blah); 
      }
  }
  </code></pre>
  
  <p>Whenever I execute the call, it returns a 404 Not Found error.  When I look at the request, it looks like this:</p>
  
  <pre><code>http://localhost:56569/Home/Tables/GetExpenseTypes
  </code></pre>
  
  <p>If it matters, this is my RouteConfig.cs:</p>
  
  <pre><code>routes.MapRoute(
      name: "Default",
      url: "{controller}/{action}/{id}",
      defaults: new { controller = "Home", action = "Index", id = 
      UrlParameter.Optional }
  );
  </code></pre>
  
  <p>Why does my request want to go to the Home controller no matter what?  If I precede the controller/Action with a forward slash:</p>
  
  <pre><code>$('#somevalue').autocomplete({
      source: '@Url.Action("/Tables/GetExpenseTypes")'
  });
  </code></pre>
  
  <p>It makes no difference, the request is still routed to the Home controller</p>