Modifying Content on ItemDataBound

G

Guest

Hi,

I have a datarepeater, which has ItemTemplates. In the ItemDataBound Event
Handler I want to modify the content of the item.

Say for example
<ItemTemplate>
<span class="Normal"><%# DataBinder.Eval(Container.DataItem,"Description") %>
</ItemTemplate>

I would like to alter the 'Description' based on some logic in the code.

Can I do this?

Your help would be greatly appreciated.
Thnx
 
L

Lukas Kurka

First add closing tag for span :)

In ItemDataBound Event i use e.blabla.Controls collection. I guess its not
the best aproach (because when you change design, you have to rewrite logic
or at least the indexes :( ), but that was the only one I was able to find
out.

If you find more elegant way please let me know.

Lukas
 

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,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top