LimitedWebPartManager.AddWebPart メソッド
Adds a Web Part to the Web Part Page.
名前空間: Microsoft.SharePoint.Client.WebParts
アセンブリ: Microsoft.SharePoint.Client.Silverlight (Microsoft.SharePoint.Client.Silverlight.dll 内); Microsoft.SharePoint.Client.Phone (Microsoft.SharePoint.Client.Phone.dll 内) Microsoft.SharePoint.Client (Microsoft.SharePoint.Client.dll 内)
構文
'宣言
Public Function AddWebPart ( _
webPart As WebPart, _
zoneId As String, _
zoneIndex As Integer _
) As WebPartDefinition
'使用
Dim instance As LimitedWebPartManager
Dim webPart As WebPart
Dim zoneId As String
Dim zoneIndex As Integer
Dim returnValue As WebPartDefinition
returnValue = instance.AddWebPart(webPart, _
zoneId, zoneIndex)
public WebPartDefinition AddWebPart(
WebPart webPart,
string zoneId,
int zoneIndex
)
パラメーター
webPart
型: Microsoft.SharePoint.Client.WebParts.WebPartThe Web Part to add to the Web Part Page.
zoneId
型: System.StringThe name of the Web Part zone to which to add the Web Part.
zoneIndex
型: System.Int32A Web Part zone index that specifies the position at which the Web Part will be inserted within the Web Part zone.
戻り値
型: Microsoft.SharePoint.Client.WebParts.WebPartDefinition
Returns a WebPartDefinition instance representing the position at which the Web Part will be inserted within the Web Part zone.
例外
例外 | 条件 |
---|---|
[System.UnauthorizedAccessException] | The current user has insufficient permissions. Error code: -2147024891 |
注釈
When Scope is User, the current user must have permissions to add and delete personalized Web Parts. When Scope is Shared, the current user must have permissions to customize pages. See also: ImportWebPart, in the following section. Use ImportWebPart to import a Web Part, and then use AddWebPart to add it to the Web Part Page. Each Web Part zone must have a unique name. It must not be null 参照 (Visual Basic のNothing ). It must not be empty. Its length must be equal to or less than 64.
The new Web Part must be inserted directly before the existing Web Part with the lowest Web Part zone index greater than or equal to zoneIndex. If zoneIndex is greater than the index of all Web Parts in the zone or there are no Web Parts in the Web Part zone, then the new Web Part must be inserted at the end of the Web Part zone. Its value must be equal to or greater than 0.