WebPartDefinition.MoveWebPartTo Method

Moves the Web Part to a different location on a Web Part Page.

Namespace:  Microsoft.SharePoint.Client.WebParts
Assemblies:   Microsoft.SharePoint.Client.Silverlight (in Microsoft.SharePoint.Client.Silverlight.dll);  Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)

Syntax

'Declaration
<RemoteAttribute> _
Public Sub MoveWebPartTo ( _
    zoneID As String, _
    zoneIndex As Integer _
)
'Usage
Dim instance As WebPartDefinition
Dim zoneID As String
Dim zoneIndex As Integer

instance.MoveWebPartTo(zoneID, zoneIndex)
[RemoteAttribute]
public void MoveWebPartTo(
    string zoneID,
    int zoneIndex
)

Parameters

  • zoneID
    Type: System.String

    The name of the Web Part zone to which to move the Web Part.

    Each Web Part zone must have a unique name. It must not be a null reference (Nothing in Visual Basic). It must not be empty. Its length must be equal to or less than 64.

  • zoneIndex
    Type: System.Int32

    A Web Part zone index that specifies the position at which the Web Part is to be moved within the destination Web Part zone.

    The zoneIndex parameter for this method follows the same behavior as the zoneIndex parameter for LimitedWebPartManager.AddWebPart.

    The zoneIndex parameter for LimitedWebPartManager.AddWebPart.method is a Web Part zone index that specifies the position at which the Web Part will be inserted within the Web Part zone. 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.

Remarks

If the current user does not have permissions to modify the Web Part, the server must ignore the call to this method.

See Also

Reference

WebPartDefinition Class

WebPartDefinition Members

Microsoft.SharePoint.Client.WebParts Namespace