SPWeb.GetWebPartCollection 方法
请注意:此 API 现在已过时。
Use the GetLimitedWebPartManager method of the SPFile class to return an SPLimitedWebPartManager object to manage Web Parts instead. (In Windows SharePoint Services 2.0 the GetWebPartCollection method returned the collection of Web Parts on the page at the specified URL.)
命名空间: Microsoft.SharePoint
程序集: Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)
语法
声明
<ObsoleteAttribute("Use SPWeb.GetLimitedWebPartManager instead.")> _
Public Function GetWebPartCollection ( _
fullOrRelativeUrl As String, _
storage As Storage _
) As SPWebPartCollection
用法
Dim instance As SPWeb
Dim fullOrRelativeUrl As String
Dim storage As Storage
Dim returnValue As SPWebPartCollection
returnValue = instance.GetWebPartCollection(fullOrRelativeUrl, _
storage)
[ObsoleteAttribute("Use SPWeb.GetLimitedWebPartManager instead.")]
public SPWebPartCollection GetWebPartCollection(
string fullOrRelativeUrl,
Storage storage
)
参数
fullOrRelativeUrl
类型:System.StringA string that contains the absolute URL or the relative URL for the Web Part page.
storage
类型:Microsoft.SharePoint.WebPartPages.StorageAn Storage value that specifies the scope of the collection that is returned, according to either all users or individual users of the collection.
返回值
类型:Microsoft.SharePoint.SPWebPartCollection
An SPWebPartCollection object that represents the Web Parts on the Web Part page.
备注
The GetWebPartCollection method returns an ArgumentException exception if an invalid value is passed for the storage parameter. Valid values are Storage.Shared or Storage.Personal.