SPSite.SetUrl method

Set secondary URL and zone for the site collection. If the URL exist for the site collection, then we only update the zone for the existing URL. If the URL does not exist, we will add the URL and the zone for the site collection.

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


Public Sub SetUrl ( _
    uri As Uri, _
    zone As SPUrlZone _
Dim instance As SPSite
Dim uri As Uri
Dim zone As SPUrlZone

instance.SetUrl(uri, zone)
public void SetUrl(
    Uri uri,
    SPUrlZone zone


  • uri
    Type: System.Uri

    The URL to set for the site collection.

See also


SPSite class

SPSite members

Microsoft.SharePoint namespace