ProfileService.GetPropertiesForCurrentUser Method (IEnumerable<String>, Boolean)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Retrieves the specified profile properties and values for the current user.

Namespace:   System.Web.ApplicationServices
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

public Dictionary<string, object> GetPropertiesForCurrentUser(
	IEnumerable<string> properties,
	bool authenticatedUserOnly


Type: System.Collections.Generic.IEnumerable<String>

A collection of string values that contains the names of the profile properties to retrieve.

Type: System.Boolean

A value that indicates whether properties are returned only for users who have been authenticated.

Return Value

Type: System.Collections.Generic.Dictionary<String, Object>

The profile property information and values.

Exception Condition

The properties parameter or an item in the properties collection is null.

To get specific profile property values for the current users, you use the GetPropertiesForCurrentUser method to specify which profile properties are retrieved. The GetPropertiesForCurrentUser method returns values only for profile properties that are configured for access through a Web service. You configure a profile property for access through a Web service by setting the ReadAccessProperties property or WriteAccessProperties property to true.

.NET Framework
Available since 3.5
Return to top