共用方式為


Web.WebTemplate 屬性

取得建立網站所用的網站定義或網站範本名稱。

命名空間:  Microsoft.SharePoint.Client
組件:   Microsoft.SharePoint.Client.Silverlight (在 Microsoft.SharePoint.Client.Silverlight.dll 中);  Microsoft.SharePoint.Client.Phone (在 Microsoft.SharePoint.Client.Phone.dll 中)  Microsoft.SharePoint.Client (在 Microsoft.SharePoint.Client.dll 中)

語法

'宣告
Public ReadOnly Property WebTemplate As String
    Get
'用途
Dim instance As Web
Dim value As String

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

屬性值

類型:System.String
字串,包含網站定義的名稱。此值會對應至Name屬性的範本中的項目共同作業應用程式標記語言 (連同 CAML)

備註

此屬性的可能值,也會提供WebTemplate類別中的常數。例如,wiki 網站的網站定義的名稱是 「 WIKI 」,也是常數SPWebTemplate.WebTemplateWIKI的值。

當您儲存在網站另存為範本,以建立自訂網站範本,然後從該範本建立新的網站時, WebTemplate屬性會包含自訂範本衍生出,不是自訂的範本名稱網站定義的名稱。如此會建立新範本的所有網站的WebTemplate屬性如果用來建立自訂範本的網站是標準的小組網站定義建立本身,會傳回 「 STS 」 (或常數SPWebTemplate.WebTemplateSTS的值)。

請參閱

參照

Web 類別

Web 成員

Microsoft.SharePoint.Client 命名空間