title: How can my route use optional parameters in the middle of the URL using ASP MVC3?
body: <p>I would like my URLs to use the convention:</p>
  
  <pre><code>/{controller}/{id}/{action}
  </code></pre>
  
  <p>rather than</p>
  
  <pre><code>/{controller}/{action}/{id}
  </code></pre>
  
  <p>I tried setting up a route as follows:</p>
  
  <pre class="lang-cs prettyprint-override"><code>routes.MapRoute(
              "Campaign",
              "{controller}/{action}/{id}",
              new { controller = "Campaign", action = "Index", id = UrlParameter.Optional } 
          );
  </code></pre>
  
  <p>But this doesn't work because I am unable to make the id parameter optional.</p>
  
  <p>The following URLs <strong>do work</strong>:</p>
  
  <pre><code>/campaign/1234/dashboard
  /campaign/1234/edit
  /campaign/1234/delete
  </code></pre>
  
  <p>But these URLs <strong>do not</strong>:</p>
  
  <pre><code>/campaign/create
  /campaign/indexempty
  </code></pre>
  
  <p>MVC just calls <code>Index</code> for both. What am I doing wrong?</p>