Exception while invoking response.redirect
<p>We have a global exception class, which grabs all exceptions in the web application. General response is to redirect the user to error page. </p>

<p>Now when an exception is raised from Update panel, response.redirect throws an exception saying <strong>Server cannot clear headers after HTTP headers have been sent.</strong>  with this stack trace:</p>

<blockquote>
  <p><em>at System.Web.HttpResponse.ClearHeaders()  at System.Web.Handlers.ScriptModule.EndRequestHandler(Object sender,
  EventArgs e)  at
  System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
      at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously)</em></p>
</blockquote>

<p>I have already tried, 
1. JS script
2. clearing header and content</p>
