Partager via


SPWeb.WebTemplate Property

Gets the name of the site definition that was used to create the site, or gets the name of the site definition from which the site template that was used to create the site is derived.

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

Syntax

Public ReadOnly Property WebTemplate As String
    Get

Dim instance As SPWeb
Dim value As String

value = instance.WebTemplate
public string WebTemplate { get; }

Property Value

Type: System.String
A string that contains the name of the site definition. This value corresponds to the Name attribute of the Template element in Collaborative Application Markup Language (CAML).

Remarks

When you create a custom template by saving a site as a template and then create a site from that template, the WebTemplate property contains the name of the site definition from which the custom template derives, not the name of the custom template.

See Also

Reference

SPWeb Class

SPWeb Members

Microsoft.SharePoint Namespace