web.config defaultRedirect not working
<p>I have a problem to redirect to my error page.
In global.asax I have implemented Application_Error, so I can catch and log errors.</p>

<p>If I put this:</p>

<pre><code>&lt;customErrors mode="On" defaultRedirect="~/Errore.html" /&gt;
</code></pre>

<p>everything works...</p>

<p>with this:  </p>

<pre><code>&lt;customErrors mode="On" defaultRedirect="~/Errore.aspx" /&gt;
</code></pre>

<p>it is show the page:
<a href="http://localhost:3821/Errore.aspx?aspxerrorpath=/pagine/Ricerca.aspx" rel="nofollow">http://localhost:3821/Errore.aspx?aspxerrorpath=/pagine/Ricerca.aspx</a></p>

<p>BUT on Errore.aspx  Page_load() or OnError() are not called, and the page showed is just the standar one, (runtime error) that suggest to change to off the mode in customErrors.</p>

<p>This is on my pc, so there is not IIS... ...and I don't use authentication (not yet)</p>

<p>Any clue?</p>

<p>Thanks,
Alberto</p>

<p>UPDATE:
The error occur in Global.aspx, in Application_Start() . When the error occur, redirecting to an .aspx page will cause an error because the app is not up. The solution is to redirec to an html page.
Thanks to everyone
Alberto</p>
