This documentation is archived and is not being maintained.

ProfileGroupBase::GetPropertyValue Method

Gets the value of a grouped profile property.

Namespace:  System.Web.Profile
Assembly:  System.Web (in System.Web.dll)

public:
Object^ GetPropertyValue(
	String^ propertyName
)

Parameters

propertyName
Type: System::String

The name of the grouped profile property.

Return Value

Type: System::Object
The value of the grouped profile property typed as object.

ASP.NET uses the 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 ProfileBase class. Strongly typed accessors are added to the ProfileCommon class for each group and property defined in the profile Element (ASP.NET Settings Schema) configuration section. The strongly typed accessors of the ProfileCommon class call the GetPropertyValue method to retrieve untyped values from the ProfileProvider that the generated accessor then casts as the specified type and returns as the grouped property value.

You can use the GetPropertyValue 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 Profile property, for example, Profile.Address.City.

The following code example shows an ASP.NET page that reads and sets the grouped properties specified for the user profile. For an example of a Web.config file that specifies grouped properties for the user profile, see the example provided for the ProfileGroupBase class.

Security noteSecurity Note:

This example contains a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview.

No code example is currently available or this language may not be supported.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Show: