Condividi tramite


Sys.Services ProfileService load Method

Loads the specified profile properties.

Sys.Services.ProfileService.load(propertyNames, loadCompletedCallback, failedCallback, userContext);

Parameters

Parameter

Description

propertyNames

A string array that contains the profile properties to load.

loadCompletedCallback

The function that is called when loading has completed. The default is null.

failedCallback

The function that is called when loading has failed. The default is null.

userContext

User context information passed to the callback functions.

Remarks

If propertyNames is not supplied, all profile properties enabled for read access are loaded from the server. The loaded profile can then be accessed directly from the properties field. This enables your application to access the profile properties by using simple field syntax, as shown in the following example:

Sys.Services.ProfileService.properties.FieldName;

If the call to the profile service fails, the function specified in the defaultFailedCallback property is called. If the call succeeds, the function specified in the defaultLoadCompletedCallback property is called.

Example

The following example shows how to use the load method to load the profile for the currently authenticated user. This code is part of a complete example found in the Sys.Services.ProfileService class overview.

 Sys.Services.ProfileService.load(null, 
        LoadCompletedCallback, ProfileFailedCallback, null);

See Also

Concepts

Sys.Services.AuthenticationService Class

Sys.Net.WebServiceProxy Class