Share via


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.

[c#]

string oldAnchor = this.WebAnchorLocation;
this.WebAnchorLocation = ownerWeb.GetVariationUrlFromSourceUrl(oldAnchor);

See Also

Reference

PublishingWeb Class

PublishingWeb Members

Microsoft.SharePoint.Publishing Namespace