Share via


SPWebPartCollection.Add Method (WebPart)

NOTE: This API is now obsolete.

Obsolete. Adds the specified Web Part to the collection.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
<ObsoleteAttribute("Use SPLimitedWebPartManager instead.")> _
Public Function Add ( _
    webPart As WebPart _
) As Guid
'Usage
Dim instance As SPWebPartCollection
Dim webPart As WebPart
Dim returnValue As Guid

returnValue = instance.Add(webPart)
[ObsoleteAttribute("Use SPLimitedWebPartManager instead.")]
public Guid Add(
    WebPart webPart
)

Parameters

Return Value

Type: System.Guid
A GUID that identifies the Web Part.

See Also

Reference

SPWebPartCollection Class

SPWebPartCollection Members

Add Overload

Microsoft.SharePoint Namespace