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)

Syntax

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

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

Parameters

Return value

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

Remarks

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

Examples

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

Reference

PublishingWeb class

PublishingWeb members

Microsoft.SharePoint.Publishing namespace