ProfileGroupBase.SetPropertyValue Method (String, Object)
Sets the value of a grouped profile property.
Assembly: System.Web (in System.Web.dll)
ASP.NET uses the 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 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 method to pass grouped property values to the ProfileProvider to be stored at the data source.
You can use the Profile property, for example, Profile.Address.City.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
The following ASP.NET page 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.
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.
Available since 2.0