title: ASP.net MVC RenderAction and Route
body: <p>I have a web project using ASP.net MVC3. There's an child action in my project. I use </p>
  
  <pre><code>&lt;% Html.RenderAction("Navigator", "Application");%&gt;
  </code></pre>
  
  <p>to call a shared action. But I find that if my current url is "localhost/application", it throws an exception "No route in the route table matches the supplied values". But when current url is "localhost/application/index", it works fine. Index is a default action in my route config, which is shown below:</p>
  
  <pre><code>    public static void RegisterRoutesTo(RouteCollection routes)
      {
          routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
          routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
          //routes.IgnoreRoute("{*chartName}", new { chartName = @"(.*)?Chart.aspx" }); //ignore request for charting request
          routes.Ignore("{*pathInfo}", new { pathInfo = @"^.*(ChartImg.axd)$" });
  
          routes.MapRoute(
              "Default",                                              // Route name
              "{controller}/{id}/{action}",                          // URL with parameters
              new { controller = "Home", action = "Index", id = UrlParameter.Optional },  // Parameter defaults
              new { httpMethod = new HttpMethodConstraint("GET", "POST") }   // Allowed http methods
          );
      }
  </code></pre>
  
  <p>Note that I switch default id and action position. I see mvc can remove the default controller and action name in url when using "Html.ActionLink(...)". And I don't like to use explicit url string in my views. How can make it work?</p>
  
  <p>My Action code is simple:</p>
  
  <pre><code>    [ChildActionOnly]
      public ActionResult Navigator()
      {
          return PartialView(appFacility.GetAll());
      }
  </code></pre>
  
  <p>Thanks alot.</p>