title: ASP.NET MVC Url.Action routing error
body: <p>I've been using this some while now, but I can't seem to figure out, where could be mistake in this simple code:</p>
  
  <pre><code>&lt;a href="&lt;%= Url.Action("Page", new { page=(Model.PageIndex + 1) }) %&gt;" &gt;a&lt;/a&gt;
  </code></pre>
  
  <p>With this routing table:</p>
  
  <pre><code>routes.MapRoute(
              "Paging",
              "Home/Page/{page}",
              new { controller = "Home", action = "Index" }
          );
  
          routes.MapRoute(
              "Default",                                              // Route name
              "{controller}/{action}/{id}",                           // URL with parameters
              new { controller = "Home", action = "Index", id = "" }  // Parameter defaults
          );
  </code></pre>
  
  <p>And of course this method</p>
  
  <pre><code>public ActionResult Index(int? page)
  </code></pre>
  
  <p>I am getting instead of expected address <a href="http://localhost:58296/Home/Page/1" rel="nofollow noreferrer">http://localhost:58296/Home/Page/1</a> the one <a href="http://localhost:58296/Home/Page?page=1" rel="nofollow noreferrer">http://localhost:58296/Home/Page?page=1</a></p>
  
  <p>When using </p>
  
  <pre><code>&lt;%= Html.RouteLink("a", "Paging", new { page=(Model.PageIndex+1) }) %&gt;
  </code></pre>
  
  <p>it works.. Please, where is my mistake? I want image link, so if there is a way to insert it into Html.RouteLink, I would appriciate that info too.</p>
  
  <p>Thanks in advance.</p>