System.Web.Profile.ProfileGroupBase.SetPropertyValue Method

Sets the value of a grouped profile property.

Syntax

public void SetPropertyValue (string propertyName, object propertyValue)

Parameters

propertyName
The name of the grouped property to set.
propertyValue
The value to assign to the grouped property.

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 group and property defined in the profile configuration section. The strongly typed accessors of the ProfileCommon class call the ProfileGroupBase.SetPropertyValue(string, object) method to pass grouped property values to the System.Web.Profile.ProfileProvider to be stored at the data source.

You can use the ProfileGroupBase.SetPropertyValue(string, object) method to assign values to grouped properties of the user profile for your application by name. Values are typed as object, and type checking will be done at run time, not compile time. 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