Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi friends
i have one listview and in this listviw i have one label and my problem is how to find label control in listview
thaks
Posted

1 solution

Try this:
C#
foreach (ListViewItem item in ListView1.Items)
{
    Label lblTest = (Label)item.FindControl("lblTest");//lblTest is the label inside listview
    if(lblTest!=null){
         //Write your code here
         Response.Write(lblTest.Text);
    }
}

Also check : Find Control or Datakeys on ItemCommand Event of ListView[^]

--Amit
 
Share this answer
 
Comments
[no name] 17-Jun-13 2:26am    
Thanks
_Amy 17-Jun-13 2:27am    
Welcome. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900