This documentation is archived and is not being maintained.

TemplatedControlDesigner.GetTemplateContainerDataSource Method

Gets the data source of the template's container.

[Visual Basic]
Public Overridable Function GetTemplateContainerDataSource( _
   ByVal templateName As String _
) As IEnumerable
[C#]
public virtual IEnumerable GetTemplateContainerDataSource(
 string templateName
);
[C++]
public: virtual IEnumerable* GetTemplateContainerDataSource(
 String* templateName
);
[JScript]
public function GetTemplateContainerDataSource(
   templateName : String
) : IEnumerable;

Parameters

templateName
The name of the template.

Return Value

The data source of the container of the specified template.

Example

[Visual Basic] The following code example overrides the GetTemplateContainerDataSource method to return the data source selected for use with the current TemplatedControlDesigner class.

[Visual Basic] 
' Override the GetTemplateContainerDataSource to return the 
' data source to be used by the templated control.    
Public Overrides Function GetTemplateContainerDataSource(templateName As String) As IEnumerable
   Return CType(Me, IDataSourceProvider).GetResolvedSelectedDataSource()
End Function

Public Overrides Function GetTemplateContainerDataItemProperty(templateName As String) As String
   Return "DataItem"
End Function

[C#, C++, JScript] No example is available for C#, C++, or JScript. To view a Visual Basic example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

TemplatedControlDesigner Class | TemplatedControlDesigner Members | System.Web.UI.Design Namespace

Show: