Represents a collection of
SPWeb objects.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
Visual Basic (Declaration)
<DefaultMemberAttribute("Item")> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel:=True)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel:=True)> _
Public Class SPWebCollection
Inherits SPBaseCollection
Dim instance As SPWebCollection
[DefaultMemberAttribute("Item")]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)]
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel=true)]
public class SPWebCollection : SPBaseCollection
Use the >Webs property of the SPWeb class to return all the subsites beneath a site, the >AllWebs property of the SPSite class to return all sites within the site collection, or one of the GetSubwebsForCurrentUser methods of the SPWeb class to return all the subsites for the current user.
Use an indexer to return a single Web site from the collection. For example, if the collection is assigned to a variable named collWebSites, use collWebSites[index] in C#, or collWebSites(index) in Visual Basic, where index is the index number of the site in the collection, the display name of the Web site, or the GUID for the site collection.
System.Object
Microsoft.SharePoint.Administration.SPAutoSerializingObject
Microsoft.SharePoint.SPBaseCollection
Microsoft.SharePoint.SPWebCollection
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.