title: How do I access the id parameter from the ActionLink?
body: <p>The issue is that id = 5 is already in the URL as <code>http://localhost:4032/Category/5</code>. But to pass that value to the ActionLink it seems I have to do this:</p>
  
  <pre><code>&lt;td&gt; @Html.ActionLink(p.ProdNo, "Main", "Home", new { id = 5, prodno = p.ProdNo }, null) &lt;/td&gt;
  </code></pre>
  
  <p>Which results in the correct URL: <code>http://localhost:4032/Main/5/1097</code></p>
  
  <p>But having to do that doesn't seem very right. I know there must be some clever way to handle this. Unfortunately, it's late in the day and I'm all out of clever.</p>
  
  <p>I tried this:</p>
  
  <pre><code>&lt;td&gt; @Html.ActionLink(p.ProdNo, "Main", "Home", new {prodno = p.ProdNo }, null) &lt;/td&gt;
  </code></pre>
  
  <p>But ended up with <code>http://localhost:4032/Main?prodno=1097</code>.</p>
  
  <p>I tried adding the parameters to the corresponding method in the codebehind but that didn't seem to work either.</p>
  
  <p>So in short, when using an ActionLink how do I get the routevalue already in the URL AND pass in another/new routevalue?</p>
  
  <p>Global.asax</p>
  
  <pre><code>public static void RegisterRoutes(RouteCollection routes)
          {
              routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
              routes.MapRoute(
                  "Sections", // Route name
                  "{controller}/{action}/{id}/{prodno}/{instid}/{section}", // URL with parameters
                  new { controller = "TestEdit", action = "Index", id = UrlParameter.Optional, prodno = UrlParameter.Optional, instid = UrlParameter.Optional, section = UrlParameter.Optional } // Parameter defaults
              );
  
              routes.MapRoute(
                  "Pumps", // Route name
                  "{controller}/{action}/{id}/{prodno}", // URL with parameters
                  new { controller = "Home", action = "Main", id = UrlParameter.Optional, prodno = UrlParameter.Optional  } // Parameter defaults
              );
  
              routes.MapRoute(
                  "Jobs", // Route name
                  "{controller}/{action}/{id}", // URL with parameters
                  new { controller = "Home", action = "Jobs", id = UrlParameter.Optional } // Parameter defaults
              );
  
              routes.MapRoute(
                  "Default", // Route name
                  "{controller}/{action}/{id}", // URL with parameters
                  new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
              );
  
          }
  </code></pre>