Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 11, 2012 04:59 PM by mebinici
May 11, 2012 10:20 AM|LINK
how i can find a control lost in a listview?
i have an <asp:image> in listview which bind the path form database.
how i can refer to each image individualy??? i m using my pop up function to show each selected image on popup panel using modelpopup.
i have a modalpopupextender it needs a TargetcontrolID, should i give the image1 as its target or the listview1 as targetcontrolid??
May 11, 2012 10:24 AM|LINK
Iterate Listview.Items and then you can get image controls using item[index...].FindControl("Your image");
May 11, 2012 11:40 AM|LINK
check this link
May 11, 2012 11:52 AM|LINK
May 11, 2012 02:05 PM|LINK
can any one give me example?how to do that?
May 11, 2012 02:52 PM|LINK
where should i do the itrations in page load event or in listviewsselectedindex function???
i have a modalpopupextender it needs a TargetcontrolID, should i give the image1 as its target or the listview1 as targetcontrolid???
May 11, 2012 04:59 PM|LINK
When you bind your control (ListView), look at these:
Protected Sub ContactsListView_ItemDataBound(ByVal sender As Object, _
ByVal e As ListViewItemEventArgs)
If e.Item.ItemType = ListViewItemType.DataItem Then
' Display the e-mail address in italics.
Dim EmailAddressLabel As Label = _
EmailAddressLabel.Font.Italic = True
Dim rowView As System.Data.DataRowView
rowView = CType(e.Item.DataItem, System.Data.DataRowView)
Dim currentEmailAddress As String = rowView("EmailAddress").ToString()
If currentEmailAddress = "email@example.com" Then
EmailAddressLabel.Font.Bold = True
As everyone has mentioned, you can loop (iterate) through each control/item within the parent control to find (findcontrol("the_control")) and get/set values.