title: ASP.NET MVC: How to serve content while returning status code 404?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2551959/how-to-configure-iis-to-serve-my-404-response-with-my-custom-content">How to configure IIS to serve my 404 response with my custom content?</a>  </p>
  </blockquote>
  
  
  
  <p>I would like to serve a user friendly "not found" page in my ASP.NET MVC application while providing a 404 status code. (based on <a href="https://stackoverflow.com/questions/2547430/how-to-return-proper-404-for-google-while-providing-user-friendly-content-to-the/2547471#2547471">this answer</a>)</p>
  
  <p>I already have the mechanism how to catch an invalid route and the custom 404 page is served by my <code>ErrorController/Handle404</code> action. </p>
  
  <p>My current implementation of <code>Handle404</code>:</p>
  
  <pre><code>    public ActionResult Handle404()
      {
          Response.StatusCode = 404;
          return View("NotFound");
      }
  </code></pre>
  
  <p>Currently, IIS serves the page as <code>404 - File or directory not found.
  The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.</code> (the standard IIS page, not my user friendly content)</p>
  
  <p>How can I include the 404 status code in the result served by the <code>Handle404</code> action while still serving the content?</p>