PublishingWeb.GetVariationUrlFromSourceUrl method

Returns the current Variation URL for the current PublishingWeb object for a specific source PublishingWeb location.

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


Public Function GetVariationUrlFromSourceUrl ( _
    sourceUrl As String _
) As String
Dim instance As PublishingWeb
Dim sourceUrl As String
Dim returnValue As String

returnValue = instance.GetVariationUrlFromSourceUrl(sourceUrl)
public string GetVariationUrlFromSourceUrl(
    string sourceUrl


Return value

Type: System.String
The corresponding URL of the sourceUrl in the current PublishingWeb.


This method is most commonly used for implementing the IWebPartVariationUpdate interface.


This code snippet demonstrates a Web Part that uses GetVariationUrlFromSourceUrl to translate its property WebAnchorLocation from an old value based on the PublishingWeb object named ownerWeb into its appropriate value in the current PublishingWeb.

string oldAnchor = this.WebAnchorLocation;
this.WebAnchorLocation = ownerWeb.GetVariationUrlFromSourceUrl(oldAnchor);
Dim oldAnchor As String = Me.WebAnchorLocation
Me.WebAnchorLocation = ownerWeb.GetVariationUrlFromSourceUrl(oldAnchor)

See also


PublishingWeb class

PublishingWeb members

Microsoft.SharePoint.Publishing namespace