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.

 

 

 

 

 

 

 

Generated Proxy Classes defaultSucceededCallback Property

Gets or sets the default succeeded callback function for the generated proxy class and its instances. This property exists at run time after the proxy class has been generated by the server.

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

// Syntax for the generated proxy class.
var succeededCallback = MyNameSpace.MyServiceProxy.get_defaultSucceededCallback(); 
MyNameSpace.MyServiceProxy.set_defaultSucceededCallback(handler);

// Syntax for a proxy instance.
var succeededCallback = myServiceProxy.get_defaultSucceededCallback(); 
myServiceProxy.set_defaultSucceededCallback(handler); 

Parameter

Description

handler

The succeeded callback function.

Return Value

The succeeded callback function, if set; otherwise, null.

Remarks

The succeeded callback function is invoked when a call to a Web service method has finished successfully.

The succeeded callback function can be passed as a parameter during any call to a Web service method. If you pass a succeeded callback function when you call a Web service method, the passed function overrides the function that is set by using the defaultSucceededCallback property.

Example

The following example shows how to set and get the defaultSucceededCallback property for the generated proxy class and for a proxy instance.

javascript

// This function sets and gets the default succeeded 
// callback function for the Web service generated 
// proxy class.
function AssignSucceededCallback() 
{
    // Set the default callback.
    Samples.AspNet.UsingProxyClass.set_defaultSucceededCallback(SucceededCallback);

    // Get the default callback.
    var callback = 
        Samples.AspNet.UsingProxyClass.get_defaultSucceededCallback();

    // Display the callback.
    DisplayMessage(callback);
}

javascript

// This function sets and gets the default succeeded 
// callback function for an instance of the Web service 
// generated proxy class.
function AssignInstanceSucceededCallback() 
{ 
   // Create an instance of the proxy class.
    var proxyInstance = 
        new Samples.AspNet.UsingProxyClass();

    // Set the default callback.
    proxyInstance.set_defaultSucceededCallback(SucceededCallback);

    // Get the default callback.
    var callback = proxyInstance.get_defaultSucceededCallback();

    // Display the callback.
    DisplayMessage(callback);
}