HttpResponse::End Method
Sends all currently buffered output to the client, stops execution of the page, and raises the EndRequest event.
Assembly: System.Web (in System.Web.dll)
| Exception | Condition |
|---|---|
| ThreadAbortException | The call to End has terminated the current request. |
This method is provided only for compatibility with ASP—that is, for compatibility with COM-based Web-programming technology that preceded ASP.NET. If you want to jump ahead to the EndRequest event and send a response to the client, call CompleteRequest() instead.
To mimic the behavior of the End method in ASP, this method tries to raise a [ThreadAbortException] exception. If this attempt is successful, the calling thread will be aborted, which is detrimental to your site's performance. In that case, no code after the call to the End method is executed.
If the End method is not able to raise a [ThreadAbortException], it instead flushes the response bytes to the client. It does this synchronously, which can also be detrimental to your site's performance.
In either case (whether or not a [ThreadAbortException] exception is successfully raised), the response pipeline jumps ahead to the EndRequest event.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.