title: ASP.Net MVC Routing Issue - Question Mark appears on my links
body: <p>I have a public website which accepts a pagename, this then defaults to a controller and action with the pagename as the unique identifier to render the correct view. eg. <a href="http://www.mydomain.com/homepage" rel="nofollow noreferrer">http://www.mydomain.com/homepage</a></p>
  
  <p>I also have a admin area where all CRUD stuff takes place access via a prefix of admin. eg. <a href="http://www.mydomain.com/admin/controller/action" rel="nofollow noreferrer">http://www.mydomain.com/admin/controller/action</a></p>
  
  <p>Everything has been fine until I changed something recently and now when I got to <a href="http://www.mydomain.com/homepage" rel="nofollow noreferrer">http://www.mydomain.com/homepage</a> the links I have such as:</p>
  
  <pre><code>&lt;ul id="menu"&gt;              
     &lt;li&gt;&lt;%= Html.ActionLink("Home", "Details", "WebPage", new { pageName = "homepage" }, null)%&gt;&lt;/li&gt;
     &lt;li&gt;&lt;%= Html.ActionLink("About", "Details", "WebPage", new { pageName = "homepage" }, null)%&gt;&lt;/li&gt;                    
  &lt;/ul&gt;
  </code></pre>
  
  <p>no longer appear as <a href="http://www.mydomain.com/homepage" rel="nofollow noreferrer">http://www.mydomain.com/homepage</a> but instead <a href="http://www.mydomain.com/Admin/WebPage/Details?pageName=homepage" rel="nofollow noreferrer">http://www.mydomain.com/Admin/WebPage/Details?pageName=homepage</a></p>
  
  <p>Can someone help?</p>
  
  <p>Here is my Global.asax:</p>
  
  <pre><code>    public static void RegisterRoutes(RouteCollection routes)
      {
          routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
          routes.MapRoute("AdminRoot",
              "Admin",
              new { controller = "Admin", action = "Index" }
              );
  
          routes.MapRoute(
              "LogOn",                                              // Route name
              "LogOn",                           // URL with parameters
              new { controller = "Account", action = "LogOn" },
              new { action = "LogOn" }
          );
  
          routes.MapRoute("Account",
            "Account/{action}",
            new { controller = "Account", action = "" }
            );
  
          //routes.MapRoute(
          //    "Default",                                              // Route name
          //    "{controller}/{action}/{id}",                           // URL with parameters
          //    new { controller = "Home", action = "Index", id = "" }  // Parameter defaults
          //);
  
  
          routes.MapRoute(
          "ErrorRoute",                                              // Route name
          "Error/Error404",                           // URL with parameters
          new { controller = "Error", action = "Error404" }
          );
  
  
          routes.MapRoute("Admin",
              "Admin/{controller}/{action}/{id}",
              new { controller = "Admin", action = "Index", id = "" }
              /*,new { action = "Create|Edit|Delete" }*/
              );
  
          routes.MapRoute("EventNewsData",
             "Admin/{controller}/{action}/{year}/{month}",
             new { controller = "Admin", action = "Index", year = 0, month = 0 }
              /*,new { action = "Create|Edit|Delete" }*/
             );
  
          routes.MapRoute(
              "Default",                                              // Route name
              "{pageName}/{moreInfoID}",                           // URL with parameters
              new { controller = "WebPage", action = "Details", pageName = "homepage", moreInfoID = 0 },
              new { action = "Details" }
              );
  
  
          routes.MapRoute("Error", "{*url}", new { controller = "Error", action = "Error404" });
  
      }
  </code></pre>
  
  <p><strong>UPDATE: This has fixed it but not really sure why</strong></p>
  
  <pre><code>    public static void RegisterRoutes(RouteCollection routes)
      {
          routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
          routes.MapRoute("AdminRoot",
              "Admin",
              new { controller = "Admin", action = "Index" },
              new { action = "Index" }
              );
  
          routes.MapRoute(
              "LogOn",                                              // Route name
              "LogOn",                           // URL with parameters
              new { controller = "Account", action = "LogOn" },
              new { action = "LogOn" }
          );
  
          routes.MapRoute("Account",
            "Account/{action}",
            new { controller = "Account", action = "" }
            );
  
          //routes.MapRoute(
          //    "Default",                                              // Route name
          //    "{controller}/{action}/{id}",                           // URL with parameters
          //    new { controller = "Home", action = "Index", id = "" }  // Parameter defaults
          //);
  
  
  
  
  
          routes.MapRoute("Admin",
              "Admin/{controller}/{action}/{id}",
              new { controller = "Admin", action = "Index", id = "" }
              , new { action = "Create|Edit|Delete|Index|DeleteFromIndex" }
              );
  
          routes.MapRoute("EventNewsData",
             "Admin/{controller}/{action}/{year}/{month}",
             new { controller = "Admin", action = "Index", year = 0, month = 0 }
              , new { action = "GetCalendarData" }
             );
  
          routes.MapRoute(
              "Default",                                              // Route name
              "{pageName}/{moreInfoID}",                           // URL with parameters
              new { controller = "WebPage", action = "Details", pageName = "homepage", moreInfoID = 0 },
              new { action = "Details" }
              );
  
          routes.MapRoute(
          "ErrorRoute",                                              // Route name
          "Error/Error404",                           // URL with parameters
          new { controller = "Error", action = "Error404" }
          );
  
          routes.MapRoute("Error", "{*url}", new { controller = "Error", action = "Error404" });
  
      }
  </code></pre>