Determine the error that caused a redirect in ASP.NET
<p>I have an ASP.NET web form application. In the web.config associated with this application, I handle my custom error like so:</p>

<pre><code>&lt;customErrors mode="Off" defaultRedirect="error.aspx" /&gt;
</code></pre>

<p>When a user gets to the error.aspx page, I want to determine what error caused this page to get reached. Does anyone know how I can do this?</p>

<p>Thank you!</p>
