HttpResponse::IsClientConnected Property
Gets a value indicating whether the client is still connected to the server.
Assembly: System.Web (in System.Web.dll)
The IsClientConnected property returns false when the following conditions are true:
The connection to the client was terminated. This can occur if the Close method was invoked, or if the client stopped execution of the Web page or browsed to another page.
The HttpWorkerRequest object that is handling the request is nullptr or the HttpWorkerRequest::IsClientConnected method returns false. If a custom HttpWorkerRequest object handles the request, then the HttpWorkerRequest::IsClientConnected method might be set based on custom criteria. For example, the custom worker request might force a time-out after a period of time.
The following example uses the IsClientConnected property to check whether the client that is requesting the page remains connected to the server. If IsClientConnected is true, the code calls the Redirect method, and the client will view another page. If IsClientConnected is false, then the code calls the End method and all page processing is terminated.
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.