System.Web.Profile.ProfileGroupBase.GetPropertyValue Method

Gets the value of a grouped profile property.

Syntax

public object GetPropertyValue (string propertyName)

Parameters

propertyName
The name of the grouped profile property.

Returns

The value of the grouped profile property typed as object.

Remarks

ASP.NET uses the System.Web.Profile.ProfileBase class to create the class 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 group and property defined in the profile configuration section. The strongly typed accessors of the ProfileCommon class call the ProfileGroupBase.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 grouped property value.

You can use the ProfileGroupBase.GetPropertyValue(string) method to retrieve grouped property values of the user profile for your application by name. Returned values are typed as object and must be cast as the specific object type when retrieved. For strongly typed access to profile property values, you can access the grouped property by name as a member of a group of the System.Web.HttpContext.Profile property, for example, Profile.Address.City.

Requirements

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