SP.WebParts.WebPartDefinition.moveWebPartTo(zoneID, zoneIndex) Method

Applies to: SharePoint Foundation 2010

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

SP.WebParts.WebPartDefinition.moveWebPartTo(zoneID, zoneIndex);

Parameters

  • zoneID
    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 null. It must not be empty. Its length must be equal to or less than 64.

Type: String

  • zoneIndex
    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.

Type: Int32

Applies To

SP.WebParts.WebPartDefinition Class

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

SP.WebParts.WebPartDefinition Methods

SP.WebParts.WebPartDefinition Properties

SP.WebParts Namespace