IWebPartVariationUpdate.Update method

Updates any properties within a Web Part control that are dependent on the location of the page in the server hierarchy.

Namespace:  Microsoft.SharePoint.Publishing
Assembly:  Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)

void Update(
	PublishingWeb ownerWeb
)

String oldAnchor = this.WebAnchorLocation;
//"this" is a Web Part class
this.WebAnchorLocation = ownerWeb.GetVariationUrlFromSourceUrl(oldAnchor);
Show: