N
neverstill
Hi-
I have an asp:image control in the ItemTemplate of a DataList
currently, in the ItemDataBound event, I am getting a reference to the image
control by looping through all the controls in the DataItem and checking if
it is an image control. This is ugly. I can't use "FindControl" cause I
don't know the ID as it is changed each time. I guess I could do some
tricky string work, but that would not be full proof.
Is there an easy way to get a control that is dynamically created at runtime
like this?
Any ideas?
Thanks,
Steve
I have an asp:image control in the ItemTemplate of a DataList
currently, in the ItemDataBound event, I am getting a reference to the image
control by looping through all the controls in the DataItem and checking if
it is an image control. This is ugly. I can't use "FindControl" cause I
don't know the ID as it is changed each time. I guess I could do some
tricky string work, but that would not be full proof.
Is there an easy way to get a control that is dynamically created at runtime
like this?
Any ideas?
Thanks,
Steve