title: Showing built-in Error View for MVC 3
body: <p>I followed this <a href="http://blogs.msdn.com/b/gduthie/archive/2011/03/17/get-to-know-action-filters-in-asp-net-mvc-3-using-handleerror.aspx" rel="nofollow">tutorial</a>, but I am still receiving the ASP.NET screen that says to turn on Errors do this, or to show custom error page do this.</p>
  
  <p>I have registered the HandleErrorAttribute and added the <code>&lt;customErrors mode="On" /&gt;</code> in web.config.  The attribute is sitting directly on the line before the Controller class signature.</p>
  
  <p>Am I still missing something?</p>
  
  <h2>EDIT</h2>
  
  <p>I removed the attribute from the class as you suggested, and this was the result.  Nothing special going on I don't think.</p>
  
  <p>web.config</p>
  
  <pre><code>&lt;/appSettings&gt;
    &lt;system.web&gt;
      &lt;customErrors mode="On" /&gt;
      &lt;compilation debug="true" targetFramework="4.0"&gt;
        &lt;assemblies&gt;
  </code></pre>
  
  <p>Global.asax</p>
  
  <pre><code>public static void RegisterGlobalFilters(GlobalFilterCollection filters)
          {
              filters.Add(new HandleErrorAttribute());
          }
  
          public static void RegisterRoutes(RouteCollection routes)
          {
              routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
              routes.MapRoute(
                  "Default", // Route name
                  "{controller}/{action}/{id}", // URL with parameters
                  new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
              );
  
          }
  
          protected void Application_Start()
          {
              AreaRegistration.RegisterAllAreas();
  
              RegisterGlobalFilters(GlobalFilters.Filters);
              RegisterRoutes(RouteTable.Routes);
  </code></pre>
  
  <p>Error*</p>
  
  <pre><code>Server Error in '/' Application.
  Runtime Error
  Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed.
  
  Details: To enable the details of this specific error message to be viewable on the local server machine, please create a &lt;customErrors&gt; tag within a "web.config" configuration file located in the root directory of the current web application. This &lt;customErrors&gt; tag should then have its "mode" attribute set to "RemoteOnly". To enable the details to be viewable on remote machines, please set "mode" to "Off".
  
  &lt;!-- Web.Config Configuration File --&gt;
  
  &lt;configuration&gt;
      &lt;system.web&gt;
          &lt;customErrors mode="RemoteOnly"/&gt;
      &lt;/system.web&gt;
  &lt;/configuration&gt;
  
  
  Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's &lt;customErrors&gt; configuration tag to point to a custom error page URL.
  
  &lt;!-- Web.Config Configuration File --&gt;
  
  &lt;configuration&gt;
      &lt;system.web&gt;
          &lt;customErrors mode="On" defaultRedirect="mycustompage.htm"/&gt;
      &lt;/system.web&gt;
  &lt;/configuration&gt;
  </code></pre>