Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

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 string GetVariationUrlFromSourceUrl(
	string sourceUrl
)

Parameters

sourceUrl
Type: System.String

The source PublishingWeb URL.

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);
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.