Author: Mainship | Posted on: 12/8/2009 2:22:13 PM | Views : 257

I have a listview control.  The source database has a field that contains the path to an image.  I'm using the ItemDataBound event to control whether to display the image in the Listview.  Here's the code:
Protected Sub CurrentListView_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ListViewItemEventArgs) Handles CurrentListView.ItemDataBound
    Dim Image1 As Image = CType(e.Item.FindControl("Image1"), Image)
    Dim lblImage As Label = CType(e.Item.FindControl("lblImage"), Label)
    Dim adTypeLabel As Label = CType(e.Item.FindControl("adTypeLabel"), Label)
    Dim SelectImgEdit As Button = CType(e.Item.FindControl("SelectImgEdit"), Button)

    If InStr(adTypeLabel.Text, "ZC") Or adTypeLabel.Text = "Special - C" Then
 & ...

Go to the complete details ...