Missing aspx page is causing a global exception instead of redirecting to 404 page
<p>I have a global exception handler in global.asax.cs file in the Application_Error handler which redirects to the error.aspx page.
I also have the customError section in my web.config file. When I request a non existing aspx page, the 404.aspx file is NOT shown and the Application_Error handler is fired.</p>

<p>I was expecting 404.aspx to be shown.</p>

<pre><code>&lt;customErrors mode="RemoteOnly" defaultRedirect="error.aspx"&gt;
      &lt;error statusCode="404" redirect="404.aspx"/&gt;
     &lt;/customErrors&gt;
</code></pre>
