Share via


TemplateBasedControl Class

Represents a control that is defined by a template rather than by the schema of the list.

Inheritance Hierarchy

System.Object
  System.Web.UI.Control
    Microsoft.SharePoint.WebControls.SPControl
      Microsoft.SharePoint.WebControls.TemplateBasedControl
        

Namespace:  Microsoft.SharePoint.WebControls
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
Public Class TemplateBasedControl _
    Inherits SPControl _
    Implements INamingContainer
'Usage
Dim instance As TemplateBasedControl
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public class TemplateBasedControl : SPControl, 
    INamingContainer

Remarks

Use this class (or one of its derived classes) as a base for deriving specific types of template-rendered controls. You can use an existing template that is included with Windows SharePoint Services 3.0 or create your own.

Templates are objects of type ITemplate. Typically they serve as the value of the RenderingTemplate.Template property. RenderingTemplate objects are defined in .ascx files located in the following folder:

%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\template\controltemplates

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

TemplateBasedControl Members

Microsoft.SharePoint.WebControls Namespace

Other Resources

How to: Create a Custom Field Type

Custom Field Types

Walkthrough: Creating a Custom Field Type

Inheritance Hierarchy

System.Object
  System.Web.UI.Control
    Microsoft.SharePoint.WebControls.SPControl
      Microsoft.SharePoint.WebControls.TemplateBasedControl
        Microsoft.SharePoint.WebControls.FormComponent
        Microsoft.SharePoint.WebControls.ListViewSelector
        Microsoft.SharePoint.WebControls.PagingButton
        Microsoft.SharePoint.WebControls.RecentChangesIterator
        Microsoft.SharePoint.WebControls.RecentChangesMenu
        Microsoft.SharePoint.WebControls.TemplateContainer
        Microsoft.SharePoint.WebControls.ToolBarMenuButton
        Microsoft.SharePoint.WebControls.ViewToolBar
        Microsoft.SharePoint.WebControls.WikiReport
        Microsoft.SharePoint.WebControls.WikiReportIterator