title: Implementing a Custom Error page on an ASP.Net website
body: <p>I have an ASP.Net website and I want to use a custom error page. I put the following code in my web.config</p>
  
  <pre><code>&lt;customErrors mode="On" defaultRedirect="~/error.aspx"&gt;
      &lt;error statusCode="404" redirect="~/error.aspx" /&gt;
  &lt;/customErrors&gt;
  </code></pre>
  
  <p>The problem is when i go to a URL that does not exist is still uses the 404 error page specified in IIS Manager.</p>
  
  <p><strong>Question:</strong> How can I make it use the error.aspx page I have created? Why do the settings in IIS Manager override the web.config?</p>