Search code examples
c#asp.netrepeateritemtemplate

How to Fill Repeater ItemTemplate from Code Behind?


I have to create a repeater dynamically from code behind. I want to fill the item template of this repeater from code behind but I couldn't find any kind of object to synchronize with the item template of the repeater.

Code:

Repeater rpr = new Repeater();
rpr.ItemTemplate = ??

Solution

  • You have to create instance of ITemplate. Read this example http://www.codeproject.com/Articles/240760/Dynamically-create-item-templates-server-side