Documentation for: ASP.NET Ajax Version 1.0

This documentation is for a previous version. For the current released version, see the ASP.NET Ajax documentation on MSDN.








Sys.Net.WebRequest remove_completed Method

Removes the event handler added by the add_completed method.




The executor associated with the request is responsible for raising the event by calling the completed method. The event handler is called when the associated executor finishes its work. An executor finishes its work in one of three states: completed, aborted, or timed out.


The following example shows how to add and remove the completed event handler. This code is part of a complete example found in the WebRequest class overview.


// This function adds and removes the 
// Web request completed event handler.
function WebRequestCompleted()
    // Instantiate the WebRequest.
    var wRequest =  new Sys.Net.WebRequest();

    // Set the request Url.  

    // Set the web request completed event handler,
    // for processing return data.
    alert("Added Web request completed handler");

    // Remove the web request completed event handler.
    // Comment the following two lines if you want to
    // use the handler.
    alert("Removed handler; the Web request return is not processed.");

    // Execute the request.