SPWeb.WebTemplateId Property
Gets the identifier (ID) of the site definition that was used to create the site.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
Syntax
'Declaration
Public ReadOnly Property WebTemplateId As Integer
Get
'Usage
Dim instance As SPWeb
Dim value As Integer
value = instance.WebTemplateId
public int WebTemplateId { get; }
Property Value
Type: System.Int32
A 32-bit integer that specifies the ID. This value corresponds to the ID attribute of the Template element in Collaborative Application Markup Language (CAML).
Remarks
The range of possible values for the WebTemplateId property is described in the documentation for the SPWebTemplate.WebTemplate enumeration.
When you create a custom site template by saving a site as a template and then create a new site from the custom template, the WebTemplateId property contains the ID of the site definition from which the custom template is derived.