Partilhar via


SPContentType.DocumentTemplate Property

Gets or sets the document template for the content type.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
<ClientCallableConstraintAttribute(FixedId := "urlconstraint", Type := ClientCallableConstraintType.Custom,  _
    Value := "It MUST be either absolute URL, server-relative URL, or relative to the content type resource folder for the content type")> _
<ClientCallableAttribute> _
<ClientCallableConstraintAttribute(Type := ClientCallableConstraintType.NotNull)> _
Public Property DocumentTemplate As String
    Get
    Set
'Usage
Dim instance As SPContentType
Dim value As String

value = instance.DocumentTemplate

instance.DocumentTemplate = value
[ClientCallableConstraintAttribute(FixedId = "urlconstraint", Type = ClientCallableConstraintType.Custom, 
    Value = "It MUST be either absolute URL, server-relative URL, or relative to the content type resource folder for the content type")]
[ClientCallableAttribute]
[ClientCallableConstraintAttribute(Type = ClientCallableConstraintType.NotNull)]
public string DocumentTemplate { get; set; }

Property Value

Type: System.String
The path and filename of the template.

Remarks

The document template is the file which SharePoint Foundation opens as a template when a user requests a new item of this content type.

This path can be absolute, relative to the server base URL, or relative to the content type's resource folder.

See Also

Reference

SPContentType Class

SPContentType Members

Microsoft.SharePoint Namespace

Other Resources

Introduction to Content Types

Site and List Content Types

Base Content Type Hierarchy