Share via


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)

Syntax

Protected Overrides ReadOnly Property DefaultTemplateName As String
    Get

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 C:\program files\common files\microsoft shared\web server extensions\12\template\controltemplates.

Remarks

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.

See Also

Reference

TextField Class

TextField Members

Microsoft.SharePoint.WebControls Namespace