Sys.Net.WebRequestManager defaultExecutor Property

Gets or sets the default network executor type that is used to make network requests.

Note Note

To get or set property values for client API properties, you must call property accessor methods that are named with the get_ and set_ prefixes. For example, to get or set a value for a property such as cancel, you call the get_cancel or set_cancel methods.

var dExecutor = Sys.WebRequestManager.get_defaultExecutorType ();




A reference to an implementation of the WebRequestExecutor class.

Exception type



An invalid parameter was passed.

The object that represents the default Web request executor.

Use the defaultExecutor property to get or set the default executor that is a reference to the current WebRequestExecutor object.

When the WebRequestExecutor object is ready to send a Web request to the executor, it uses the request executor you supplied. If you do not supply an executor, the WebRequestExecutor creates an instance of the XmlHttpExecutor class.

The following example shows how to get and set the default executor by using the defaultExecutorType property. This code is part of a complete example found in the WebRequestManager class overview.

// Gets and sets the default executor.
function DefaultExecutor()
    // Clear the previous results. 
    resultElement.innerHTML = "";

    // Get system default executor type.
    var sysDefaultExecutor = 
    alert("Get default executor:" + sysDefaultExecutor);

    // Modify the default executor type.

    var customDefaultExecutor = 

    alert("Set default executor: " + customDefaultExecutor);

    // Set the executor back to the system default. This is 
    // to allow the WebRequest script to run.
    executor = "Sys.Net.XMLHttpExecutor";