System.Web.Configuration.CustomErrorCollection.Clear Method

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

Syntax

public void Clear ()

Remarks

The result of updating the configuration file after calling the CustomErrorCollection.Clear method is dependent upon the System.Configuration.ConfigurationSaveMode chosen. To update the configuration file, you use one of these two overloads: System.Configuration.Configuration.Save and System.Configuration.Configuration.Save(System.Configuration.ConfigurationSaveMode).

Note:

Calling System.Configuration.Configuration.Save is equivalent to calling System.Configuration.Configuration.Save(System.Configuration.ConfigurationSaveMode).

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

The CustomErrorCollection.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