title: ASP.NET MVC Route Contraints with {ID}-{Slug} Format
body: <p>I have a route like following, ideally I would like it to match:</p>
  
  <p>domain.com/layout/1-slug-is-the-name-of-the-page</p>
  
  <pre><code>        routes.MapRoute(
              "Layout",                                                // Route name
              "layout/{id}-{slug}",                                           // URL with parameters
              new { controller = "Home", action = "Index"}, new {id = @"\d+$"}
          );
  </code></pre>
  
  <p>But when I hit the url, I am keep on getting this exception:</p>
  
  <p>The parameters dictionary contains a null entry for parameter 'id' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Index(Int32)' in ....</p>
  
  <p>The above route will match the following though:</p>
  
  <p>domain.com/layout/1-slug or domain.com/layout/1-slug_permalink</p>
  
  <p>Seems like the hyphen that separates the ID from the Slug is causing issues.</p>