title: Handling invalid MVC parameters
body: <p>In our MVC application we have a route defined as follows:</p>
  
  <pre><code>routes.MapRoute("ViewUser", "ViewUser/{userId}", new { controller = "general", action = "viewuser", userId = 0 });
  </code></pre>
  
  <p>userId is defined as an non-nullable type int, with a default value of 0.  However occasionally, we find that the google ad bot will for some unknown reason call the page as /ViewUser/phptest.php.  This results in an 500 error:</p>
  
  <pre><code>The parameters dictionary contains a null entry for parameter 'userId' of non-nullable type 'System.Int32'  
  </code></pre>
  
  <p>For the now, if we ignore the fact that google is trying to crawl an invalid url, is there anyway to force a 404 as opposed to the 500 error?</p>