asp:Image control in a DataList ItemDataBound event
Posted on 2005-05-08
I have " <asp:Image ID="imgEng" Visible=False . .> " in a DataList
I'm trying to reference it so I can set it's visible to True but can't.
This is not working, "Image" is a problem. in ItemDataBound event:
Dim imgEng As Image << not valid
imgEng = e.Item.Cells(3).FindControl("imgEng")
imgEng.Visible = True
Tried this but got the same problem:
Dim imgEngAs Image = CType(e.Item.Cells(3).FindControl("imgEng"), Image)
But controls like this work:
Dim lnkAdd As LinkButton
lnkAdd = e.Item.Cells(3).FindControl("lnkAdd")
lnkAdd.Visible = True
How is a asp:Image control referenced in a DataList?