Use HttpApplication.CompleteRequest Instead of Response.End
HttpApplication.CompleteRequest is preferable to use for aborting a request in an ASP.NET application over Response.End, because it has better performance characteristics. If you’re using Response.End, you’ve probably at one time or another encountered the ThreadAbortException that goes along with it.
The behavior of CompleteRequest changed with 2.0, as Rick describes here. However, the reason why you’ll most likely want to call CompleteRequest rather than Response.End is that, while it still short-circuits the ASP.NET pipeline (jumping immediately to the EndRequest event), it does so without throwing a ThreadAbortException.
(thanks to Stefan Schackow for this tip)




Comments
Jim Geurts said on 07 Apr 2009 at 10:08 AM
What are the performance characteristics that make it a better alternative? Is it just because it doesn't throw an exception?
ILog said on 07 Apr 2009 at 11:34 AM
Did you do any stress testing to ensure that you get no problem with ThreadPool ?
friendster graphics said on 07 May 2009 at 12:39 AM
0h i feel lucky can find this good article..
now i find something that i want to know, thank you..