471,356 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,356 software developers and data experts.

ItemDataBound text modification?

I've got a repeater that's bound to a datareader and I'd like to
conditionally modify the text that is being outputted. Previously, I've done
this by assigning a name to attribute to the surrounding tablecell in which
the <%# %> tags reside and I could use the findcontrol to grab a handle to
the control by name and do any necessary modifications. I'm wondering if I
can get around this? Is it necessary to assign a name to a surrounding cell?
What if I'm not using a table? I tried to use e.item.controls(0), but this
does not seem to correspond with all available controls that get databound (I
guess it excludes non web-server controls like simple client side tables),
but there seems to be only one element of type "DataBoundLiteralControl." I
was guessing that this represented the text that was between the databinding
tags, and hoped that I could modify the text property to add some text in,
but it's a read only property. To sum it up, two questions:

1, what is the DataBoundLiteralControl actually used for? What does it
represent?

2, Is there a way to do what I'd like to do? To modify the text that is
bound, without using findcontrol? (The control has no name, it's just the
contents of the <%# %> tags.

Thanks...
Jul 21 '05 #1
0 987

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by kscdavefl | last post: by
1 post views Thread by André Almeida Maldonado | last post: by
reply views Thread by mplutodh1 | last post: by
4 posts views Thread by Dennis E. Jones, Jr. | last post: by
reply views Thread by Ben R. | last post: by
2 posts views Thread by srini.venkatesan | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.