共用方式為


Sys.Services RoleService defaultFailedCallback Property

Gets or sets the name of the default failed callback function.

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 defaultFailedCallback =
  Sys.Services.RoleService.get_defaultFailedCallback();
Sys.Services.RoleService.set_defaultFailedCallback(value); 

Parameters

Parameter

Description

value

The name of the default failed callback function.

Remarks

The function specified in this property is used as the default callback function if the role service fails. You can override this default callback function by passing the name of a different function to the load method.

When implementing this callback function, you must use the following signature:

function callbackFunctionName(error, userContext, methodName)

The parameters passed to the callback function have the following meaning:

  • error. Contains an instance of the WebServiceError class.

  • userContext. User context information that you passed to the load method, if any.

  • methodName. The name of the calling method.

The callback function is called asynchronously if the role service fails.

Example

The following example shows how to use the defaultFailedCallback property. This code is part of a complete example found in the RoleService class overview.

// This function sets and gets the role service
// default load completed callback function.
function DefaultLoadCompletedCallBack()
{
    // Set the default callback function.
    roleProxy.set_defaultLoadCompletedCallback(LoadCompletedCallback);

    // Get the default callback function. 
    var loadCompletedCallBack =     
        roleProxy.get_defaultLoadCompletedCallback();

    alert(loadCompletedCallBack);
}

See Also

Concepts

Sys.Services.AuthenticationService Class

Sys.Services.ProfileService Class