如何在listview中找到标签 [英] how to find label in listview

查看:141
本文介绍了如何在listview中找到标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友

i有一个listview,在这个listviw中我有一个标签,我的问题是如何在listview中找到标签控件

thaks

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

推荐答案

试试这个:

Try this:
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);
    }
}



另请查看:在ListView的ItemCommand事件上查找控件或数据键 [ ^ ]



- Amit


这篇关于如何在listview中找到标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆