TextField.DefaultTemplateName property

Gets the name of the default rendering template for TextField controls.

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

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.

The default implementation returns "TextField", 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.