Düzenle

Aracılığıyla paylaş


ProfilePropertySettingsCollection.Add(ProfilePropertySettings) Method

Definition

Adds a ProfilePropertySettings object to the collection.

public:
 void Add(System::Web::Configuration::ProfilePropertySettings ^ propertySettings);
public void Add (System.Web.Configuration.ProfilePropertySettings propertySettings);
member this.Add : System.Web.Configuration.ProfilePropertySettings -> unit
Public Sub Add (propertySettings As ProfilePropertySettings)

Parameters

propertySettings
ProfilePropertySettings

A ProfilePropertySettings object to add to the collection.

Exceptions

The ProfilePropertySettings object to add already exists in the collection or the collection is read only.

Examples

The following code example shows how to use the Add method. This code example is part of a larger example provided for the ProfileSection class.

// Add a new PropertySettings to the group.
ProfilePropertySettings newProp = new ProfilePropertySettings("AvatarImage");
newProp.Type = "System.String, System.dll";
newPropGroup.PropertySettings.Add(newProp);
' Add a new PropertySettings to the group.
Dim newProp As ProfilePropertySettings = new ProfilePropertySettings("AvatarImage")
newProp.Type = "System.String, System.dll"
newPropGroup.PropertySettings.Add(newProp)

Remarks

The collection must not already contain a ProfilePropertySettings object with the same name.

Applies to

See also