OutputCacheProfileCollection.Add Method (OutputCacheProfile)

 

Adds a OutputCacheProfile object to the collection.

Namespace:   System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

Public Sub Add (
	name As OutputCacheProfile
)

Parameters

name
Type: System.Web.Configuration.OutputCacheProfile

The name of the OutputCacheProfile object to add to the collection.

Exception Condition
ConfigurationException

The OutputCacheProfile object already exists in the collection or the collection is read only.

The collection cannot contain a OutputCacheProfile object with the same name.

The following code example shows how to use the Add method.

' Execute the Add method.
  Dim outputCacheProfile0 _
  As New System.Web.Configuration.OutputCacheProfile( _
  "MyCacheProfile")
  outputCacheProfile0.Location = _
  System.Web.UI.OutputCacheLocation.Any
  outputCacheProfile0.NoStore = _
  False

  outputCacheProfiles.Add(outputCacheProfile0)

' Update if not locked.
  If Not outputCacheSettings.IsReadOnly() Then
      webConfig.Save()
  End If

.NET Framework
Available since 2.0
Return to top
Show: