1 out of 1 rated this helpful Rate this topic

ProfileService Class

Enables access to ASP.NET user profiles through a Web service.

System.Object
  System.Web.ApplicationServices.ProfileService

Namespace:  System.Web.ApplicationServices
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)
[ServiceContractAttribute(Namespace = "http://asp.net/ApplicationServices/v200")]
[AspNetCompatibilityRequirementsAttribute(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
[ServiceKnownTypeAttribute("GetKnownTypes", typeof(KnownTypesProvider))]
[ServiceBehaviorAttribute(Namespace = "http://asp.net/ApplicationServices/v200", 
	InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple)]
public class ProfileService

The ProfileService type exposes the following members.

  Name Description
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetAllPropertiesForCurrentUser Retrieves all the profile properties and values that are available to the profile service for the current user.
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetPropertiesForCurrentUser Retrieves the specified profile properties and values for the current user.
Public method GetPropertiesMetadata Retrieves information about the profile properties that are available through the profile service.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method SetPropertiesForCurrentUser Sets the values of the specified properties in the user profile.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Top
  Name Description
Public event Static member ValidatingProperties Occurs when a user's profile properties are set.
Top

The ProfileService class enables you to get and set a user's profile properties through a Windows Communication Foundation (WCF) service. You can keep custom information for users through profile properties. For information about profile properties, see ASP.NET Profile Properties Overview.

The ProfileService class contains the following methods that should be accessed only through a WCF service:

To call these methods, you must enable the profile service on the Web server and then connect a WCF-compatible client application to the Web service. For information about how to configure the profile service, see How to: Enable the WCF Profile Service.

The ValidatingProperties event is raised when a user's profile properties are set. You can create an event handler for the ValidatingProperties event to validate property values or to dynamically change their values.

For an example of how to use the WCF profile service from a console application, see Walkthrough: Using ASP.NET Application Services.

.NET Framework

Supported in: 4, 3.5

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ