title: ASP.NET MVC - Routing doesn't work
body: <p>I am practicing ASP.NET MVC using vs 2013, and writed a simple project, with one controller and view.</p>
  
  <p>controller code:</p>
  
  <pre><code>public class HomeController : Controller
  {
      // GET: Home
      public ActionResult Index()
      {
          return View();
      }
  
      public ActionResult ShowMyHome()
      {
          return View("MyHome");
      }
  } 
  </code></pre>
  
  <p>"MyHome" view Code:</p>
  
  <pre><code>@{
      Layout = null;
  }
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta name="viewport" content="width=device-width" /&gt;
      &lt;title&gt;Hello World&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div&gt; 
          Welcome my first MVC page
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>RouteConfig code:</p>
  
  <pre><code>public class RouteConfig
      {
          public static void RegisterRoutes(RouteCollection routes)
          {
              routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
              routes.MapRoute(
                  name: "Default",
                  url: "{controller}/{action}/{id}",
                  defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
  
              );
  
              routes.MapRoute(
                name: "Home",
                url: "Home",
                defaults: new { controller = "Home", action = "ShowMyHome", id = UrlParameter.Optional }
                );
          }
      }
  </code></pre>
  
  <p>when i run and set url line on "<a href="http://mySite/Home/ShowMyHome" rel="nofollow">http://mySite/Home/ShowMyHome</a>", it works well.
  but when i run and set url line on "<a href="http://mySite/Home" rel="nofollow">http://mySite/Home</a>", i get a error:</p>
  
  <pre><code>The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched:
  ~/Views/Home/Index.aspx
  ~/Views/Home/Index.ascx
  ~/Views/Shared/Index.aspx
  ~/Views/Shared/Index.ascx
  ~/Views/Home/Index.cshtml
  ~/Views/Home/Index.vbhtml
  ~/Views/Shared/Index.cshtml
  ~/Views/Shared/Index.vbhtml
  </code></pre>
  
  <p>It looks like the "Home" routing doesn't work.</p>