title: ASP.net MVC route parameter exception
body: <p>I have and action which takes a userId parameter:</p>
  
  <p>~/Users/Show?userId=1234</p>
  
  <p>Everything works fine except when the userId provided is not an int or is missing. </p>
  
  <p>Then it throws this exception:</p>
  
  <pre><code>            Message: The parameters dictionary contains a null entry for parameter 'userId' of 
      non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Show(Int32, 
  System.Nullable`1[System.Boolean], System.String)' in 'S4U.Web.Mvc.Controllers.ProfileController'. An optional parameter must be a reference type, 
      a nullable type, or be declared as an optional parameter.
          Parameter name: parameters
  </code></pre>
  
  <p>..after which the user is redirected to the error page.</p>
  
  <p>How do I configure the route so the action isn't hit at all and it throws a 404 instead?</p>