title: how to avoid runtime error pages in asp.net application
body: <p>I have an asp.net application.When I opened the application,I got a runtime exception with the description saying, "An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code".</p>
  
  <p>When ever I get this kind of runtime exception, I want to redirect page to some other aspx page.I have added the custom error tag in web.config file as :  </p>
  
  <pre><code>&lt;customErrors
     mode="RemoteOnly" 
     defaultRedirect="~/Error.aspx" /&gt;
  </code></pre>
  
  <p>But still m getting runtime error page instead of Error page.</p>