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.WebRequestExecutor xml Property

Attempts to get the response to the current request as an XMLDOM object.

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.

Syntax

var xml = MyExecutor.get_xml();

Remarks

If a request finished successfully with valid response data, this method tries to get the response as an XMLDOM object.

Example

The following example shows how to use the xml property by using the default Sys.Net.XMLHttpExecutor class.

JavaScript

// This is the event handler called after 
// the Web request returns. It is designed
// for Web requests that return XML.
function OnSucceededXml(executor, eventArgs) 
{
    if (executor.get_responseAvailable()) 
    {
        // Display XML.
       if (document.all)
            resultElementId.innerText += executor.get_xml().xml;
        else
            // Firefox 
            resultElementId.textContent += "First node: " + 
                executor.get_xml().documentElement.nodeName;

    }
    else
    {
        if (executor.get_timedOut())
            alert("Timed Out");
        else
            if (executor.get_aborted())
                alert("Aborted");
    }
}