title: System.Threading.ThreadAbortException on generic redirection
body: <p>I am working on an <code>ASP.Net</code> project where we have an <code>centralized redirection method</code>. But some times it throws an exception:</p>
  
  <blockquote>
    <p>System.Threading.ThreadAbortException</p>
  </blockquote>
  
  <p>The main problem is that often the code execution is not stopping after calling <code>SBA.Redirect("AnotherPage.aspx")</code> and the following code is still executing. </p>
  
  <p>My generic function:</p>
  
  <pre><code>public static class SBA
  {   
          public static void Redirect(string Url)
          {
                  try
                  {
                      HttpContext.Current.Response.Redirect(Url, false);
                      HttpContext.Current.ApplicationInstance.CompleteRequest();                
                  }
                  catch (Exception ex)
                  {
                      if (ex.GetType() != typeof(System.Threading.ThreadAbortException))
                      {
                          throw;
                      }
                  }
          }
  }
  </code></pre>