System.Web.Configuration.ClientTargetCollection.Clear Method

Removes all the System.Web.Configuration.ClientTarget objects from the collection.

Syntax

public void Clear ()

Remarks

The result of updating the configuration file after calling the ClientTargetCollection.Clear method is dependent upon the System.Configuration.ConfigurationSaveMode value chosen. To update the configuration file you use one of these two methods: System.Configuration.Configuration.Save or System.Configuration.Configuration.Save(System.Configuration.ConfigurationSaveMode).

Note:

Calling System.Configuration.Configuration.Save is equivalent to calling System.Configuration.Configuration.Save(System.Configuration.ConfigurationSaveMode) when the System.Configuration.ConfigurationSaveMode value is modified.

If you use the System.Configuration.Configuration.Save(System.Configuration.ConfigurationSaveMode) method, the following conditions apply:

The ClientTargetCollection.Clear method actually deletes the add elements defined in the clientTarget section of the configuration file at the current hierarchy level. It also removes all references to the add elements defined in the parent configuration files at higher levels in the hierarchy.

Note:

The add elements are not deleted from the clientTarget section of the parent configuration files.

Requirements

Namespace: System.Web.Configuration
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0