Error Page in ASP.NET MVC

Web.config
  1. <system.webServer>  
  2.     <httpErrors errorMode="Custom" existingResponse="Replace">  
  3.       <remove statusCode="404" />  
  4.       <error statusCode="404" path="/Error/NotFound" responseMode="ExecuteURL" />  
  5.     </httpErrors>  
  6. </system.webServer>  
Controller
  1. public class ErrorController : Controller  
  2. {  
  3.     public ActionResult NotFound()  
  4.     {  
  5.         Response.StatusCode = 404;  
  6.         return View();  
  7.     }  
  8. }