problem in finding control?http://forums.asp.net/t/1802721.aspx/1?problem+in+finding+control+Fri, 11 May 2012 16:59:18 -040018027214976326http://forums.asp.net/p/1802721/4976326.aspx/1?problem+in+finding+control+problem in finding control? <p>how i can find a control lost in a listview?</p> <p>i have an &lt;asp:image&gt; in listview which bind the path form database.</p> <p>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.</p> <p>i have a modalpopupextender it needs a TargetcontrolID, should i give the image1 as its target or the listview1 as targetcontrolid??</p> 2012-05-11T10:20:17-04:004976329http://forums.asp.net/p/1802721/4976329.aspx/1?Re+problem+in+finding+control+Re: problem in finding control? <p>Iterate Listview.Items and then you can get image controls using item[index...].FindControl(&quot;Your image&quot;);</p> <p>Thanks,</p> 2012-05-11T10:24:45-04:004976433http://forums.asp.net/p/1802721/4976433.aspx/1?Re+problem+in+finding+control+Re: problem in finding control? <p>check this link</p> <p>http://stackoverflow.com/questions/613277/find-control-in-listview-emptydatatemplate</p> 2012-05-11T11:40:48-04:004976466http://forums.asp.net/p/1802721/4976466.aspx/1?Re+problem+in+finding+control+Re: problem in finding control? Handle the ItemDataBound event of the listview and you can use e.Item.FindControl() to find the image in question. 2012-05-11T11:52:49-04:004976706http://forums.asp.net/p/1802721/4976706.aspx/1?Re+problem+in+finding+control+Re: problem in finding control? <p>can any one give me example?how to do that?</p> 2012-05-11T14:05:50-04:004976771http://forums.asp.net/p/1802721/4976771.aspx/1?Re+problem+in+finding+control+Re: problem in finding control? <p>&nbsp;</p> <p>where should i do the itrations in page load event or in listviewsselectedindex function???</p> <p>i have a modalpopupextender it needs a TargetcontrolID, should i give the image1 as its target or the listview1 as targetcontrolid???</p> 2012-05-11T14:52:16-04:004976941http://forums.asp.net/p/1802721/4976941.aspx/1?Re+problem+in+finding+control+Re: problem in finding control? <p>When you bind your control (ListView), look at these:</p> <h1 class="title"><a title="ListView.ItemDataBound Event" href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.listview.itemdatabound.aspx" target="_blank">ListView<span>.</span>ItemDataBound Event</a></h1> <h1 class="title"><a title="ListView.ItemCreated Event" href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.listview.itemcreated.aspx" target="_blank">ListView<span>.</span>ItemCreated Event</a></h1> <pre class="prettyprint">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 = _ CType(e.Item.FindControl(&quot;EmailAddressLabel&quot;), Label) EmailAddressLabel.Font.Italic = True Dim rowView As System.Data.DataRowView rowView = CType(e.Item.DataItem, System.Data.DataRowView) Dim currentEmailAddress As String = rowView(&quot;EmailAddress&quot;).ToString() If currentEmailAddress = &quot;orlando0@adventure-works.com&quot; Then EmailAddressLabel.Font.Bold = True End If End If End Sub</pre> <p class="title">As everyone has mentioned, you can loop (iterate) through each control/item within the parent control to find (findcontrol(&quot;the_control&quot;))&nbsp;and get/set values.</p> <p class="title"><br> &nbsp;</p> 2012-05-11T16:59:18-04:00