October 2010
Intermediate to advanced
1920 pages
73h 55m
English
ITemplate InterfaceYou create a one-way databinding template by adding a property to a control that returns an object that implements the ITemplate interface. The ITemplate interface includes one method:
• InstantiateIn—
Instantiates the contents of a template in a particular control.
You are not required to implement the InstantiateIn() method. The ASP.NET Framework creates the method for you automatically. You call the InstantiateIn method in your control to add the contents of a template to your control.
For example, the control in Listing 37.1 represents an article. The Article control includes a template named ItemTemplate, which lays out the elements of the article: title, author, and contents.
Listing 37.1. Article.cs ...
Read now
Unlock full access