Repeater.ItemTemplate =?

S

Shimon Sim

Can I dynamically create ItemTemplate for Repeater control?

I want to do something like this in code
repeater.ItemTemplete=...something that will display in repeater.
I don't know what I can assign and if it at all possible.

Thanks,
Shimon.
 
K

Karl Seguin

Shimon:
Yes you can via the Page.LoadTemplate function. It behaves a lot like
LoadControl but can be assigned, as you want, to the ItemTemplate (or any
other template)

repater.ItemTemplate = Page.LoadTemplate("someTemplate.ascx")

There are a number of resources online, such as:
http://www.aspdotnetheaven.com/Code/Jan2003/DynamicTemplate.asp , you might
also wanna check out http://www.123aspx.com/redir.aspx?res=31926 or simply
do a google search for Page.LoadTemplate or dynamic templates

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top