System.Web.Profile.ProfileBase.GetPropertyValue Method

Gets the value of a profile property.

Syntax

public object GetPropertyValue (string propertyName)

Parameters

propertyName
The name of the profile property.

Returns

The value of the specified profile property, typed as object.

Remarks

ASP.NET uses the System.Web.Profile.ProfileBase class to create the class used for the user profile. When an application that has the user profile enabled is started, ASP.NET creates a new class of type ProfileCommon, which inherits from the System.Web.Profile.ProfileBase class. Strongly typed accessors are added to the ProfileCommon class for each property defined in the profile configuration section. The strongly typed accessors of the ProfileCommon class call the ProfileBase.GetPropertyValue(string) method to retrieve untyped values from the System.Web.Profile.ProfileProvider that the generated accessor then casts as the specified type and returns as the property value.

You can use the ProfileBase.GetPropertyValue(string) method to retrieve property values of the user profile for your application by name. Returned values are untyped and must be cast as the specific object type when retrieved. For strongly typed access to profile property values, you can access the property by name as a member of the Profile property available on each page, for example, Profile.CustomerAddress.

Requirements

Namespace: System.Web.Profile
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0