Sys.Net.WebRequestExecutor executeRequest Method
Instructs the executor to execute a Web request.
When this method is called, the executor packages the content of the Web request instance and initiates processing.
This method is intended to be used by a custom executor. If you are implementing a custom executor, you instantiate the executor, assign it to the Web request instance, and then invoke the method on the executor instance.
The main phases of an executor life cycle that pertain to the executeRequest method are as follows:
An executor instance is in memory while the request progresses asynchronously on the server. The request finishes in one of the following ways:
The executor sets its state to complete and raises the completed event of the associated WebRequest object.
The executor sets its state to timedout and raises the completed event of the associated WebRequest object.
The executor sets its state to aborted and raises the completed event of the associated WebRequest object.
At this point the executor is no longer needed and you can discard it by calling its dispose method.
The following example shows how to make a Web request using the executeRequest method.
// This function executes a Web request.
// Create the WebRequest object.
wRequest = new Sys.Net.WebRequest();
// Set the request Url.
// Set the Completed event handler, for processing return data
// Clear the results area.
resultElementId.innerHTML = "";
// To use executeRequest you must instantiate the
// executor, assign it to the Web request instance,
// then call the executeRequest function.
// Note: Normally to make a Web request you use
// the invoke method of the WebRequest instance.
var executor = new Sys.Net.XMLHttpExecutor();
var started = executor.get_started();
alert("Executor started: " + started);