Share via


BaseNumberField.DefaultTemplateName property

Gets the name of the default rendering template for controls derived from BaseNumberField.

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

Syntax

'Declaration
Protected Overrides ReadOnly Property DefaultTemplateName As String
    Get
'Usage
Dim value As String

value = Me.DefaultTemplateName
protected override string DefaultTemplateName { get; }

Property value

Type: System.String
A String that names a rendering template in an .ascx file in the folder %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\template\controltemplates.

Remarks

This override returns "NumberField", which is the value of the ID attribute of a <RenderingTemplate> element in the DefaultTemplates.ascx file. It identifies the RenderingTemplate object that can be used as a fallback if the TemplateName property has never been set or if for any reason the template it names cannot be used.

If you override DefaultTemplateName, you must define your custom <RenderingTemplate> element in a custom .ascx file in the folder ...\controltemplates.

For readability and consistency with other classes derived from TemplateBasedControl, avoid using DefaultTemplateName to identify a template that you want to use in special contexts, such as on particular forms. Instead, use AlternateTemplateName.

See also

Reference

BaseNumberField class

BaseNumberField members

Microsoft.SharePoint.WebControls namespace