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

SPWebTemplateCollection class

Represents a collection of SPWebTemplate objects.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
[SubsetCallableTypeAttribute]
[ClientCallableTypeAttribute(Name = "WebTemplateCollection", ServerTypeId = "{15c2ecda-d49e-4fda-97c8-c538a203dfb5}", 
	CollectionChildItemType = typeof(SPWebTemplate), CollectionIndexerMethodClientName = "GetByName", 
	SampleUrl = "{apiroot}/web/GetAvailableWebTemplates({languageid},{includecrosslanguage})")]
public class SPWebTemplateCollection : SPBaseCollection

Use the GetCustomWebTemplates method of the SPSite class to return the collection of Web templates in the site collection, or use the GetWebTemplates method of the SPSite class to return the collection of site definition configurations in the site collection. After you have a reference to a collection, use an indexer to return a single site definition configuration or site template. For example, if the collection is assigned to a variable named myWebTemplates, use myWebTemplates[index] in Microsoft Visual C#, or myWebTemplates(index) in Microsoft Visual Basic, where index is either the title or the index number in the collection of the site definition configuration or site template.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.