This documentation is archived and is not being maintained.

SPAlternateUrlCollection Class

Windows SharePoint Services 3

Represents a collection of SPAlternateUrl objects.

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

[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public class SPAlternateUrlCollection : SPPersistedObject, 

Use the SPVirtualServerConfigAlternateUrls property of the SPVirtualServerConfig class to return an SPAlternateUrlCollection object that represents the collection of alternate request URLs for a virtual server.

To create an alternate request URL, use the SPAlternateUrlCollection constructor to instantiate a URL object, and the Add method to add the object to the collection of URL objects for the specified zone. A request URL can be specified only once per Windows SharePoint Services farm.

Use an indexer to return a single URL from the collection. For example, assuming the collection is assigned to a variable named myUrls, use myUrls[index] in Microsoft Visual C# or myUrls(index) in Microsoft Visual Basic, where index is either the index number of the item in the collection or a string containing the incoming URL of the request.

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