Lenguaje

ProfilePropertySettingsCollection.Add(ProfilePropertySettings) Método

Definición

Agrega un ProfilePropertySettings objeto a la colección.

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)

Parámetros

propertySettings
ProfilePropertySettings

Objeto ProfilePropertySettings que se va a agregar a la colección.

Excepciones

El ProfilePropertySettings objeto que se va a agregar ya existe en la colección o la colección es de solo lectura.

Ejemplos

En el ejemplo de código siguiente se muestra cómo usar el Add método . Este ejemplo de código forma parte de un ejemplo más grande proporcionado para la ProfileSection clase .

// 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)

Comentarios

La colección aún no debe contener un ProfilePropertySettings objeto con el mismo nombre.

Se aplica a

Consulte también