Share via


SPFile.GetWebPartCollection Method

NOTE: This API is now obsolete.

Use the GetLimitedWebPartManager method to return an SPLimitedWebPartManager object to manage Web Parts instead. (In Windows SharePoint Services 2.0 the GetWebPartCollection method returned the Web Part collection that is associated with the Web Parts page.)

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

Syntax

'Declaration
<ObsoleteAttribute("Use SPFile.GetLimitedWebPartManager instead.")> _
Public Function GetWebPartCollection ( _
    storage As Storage _
) As SPWebPartCollection
'Usage
Dim instance As SPFile
Dim storage As Storage
Dim returnValue As SPWebPartCollection

returnValue = instance.GetWebPartCollection(storage)
[ObsoleteAttribute("Use SPFile.GetLimitedWebPartManager instead.")]
public SPWebPartCollection GetWebPartCollection(
    Storage storage
)

Parameters

Return Value

Type: Microsoft.SharePoint.SPWebPartCollection
An object that represents the Web Parts.

Remarks

The GetWebPartCollection method does not return static Web Parts, which are hard-coded into the .aspx source of the page.

See Also

Reference

SPFile Class

SPFile Members

Microsoft.SharePoint Namespace