Export (0) Print
Expand All

SPAlternateUrlCollectionManager class

Provides methods that can be used to perform operations on all the SPAlternateUrlCollection objects in the farm.

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

[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
public sealed class SPAlternateUrlCollectionManager : SPPersistedChildCollection<SPAlternateUrlCollection>, 
	IEnumerable<SPAlternateUrlCollection>, IEnumerable<SPAlternateUrl>, IEnumerable

Use the SPFarm.AlternateUrlCollections property to return the SPAlternateUrlCollectionManager object for the server farm.

The following example verifies that the RebaseUriWithAlternateUri method converts a specified incoming URL to the default zone outgoing URL.

SPAlternateUrlCollection altUrlCollection = SPContext.Current.Site.WebApplication.AlternateUrls;

SPAlternateUrlCollectionManager altUrlCollectionMgr = SPFarm.Local.AlternateUrlCollections;

Uri incomingUri = new Uri("http://MyIncomingUrl");

Uri responseUri = altUrlCollectionMgr.RebaseUriWithAlternateUri(incomingUri, SPUrlZone.Default);

if (responseUri == altUrlCollection.GetResponseUrl(SPUrlZone.Default).Uri)
{
    Response.Write("Incoming URI converted to default outgoing URL.");
}

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft