如何获得当前控件的所在repeater的序号 repeater 控件中定义了一个listbox,在SelectedIndexChanged的事件中如何获得当前repeater的序号,就是ListBox lb = (ListBox)Repeater2.Controls[0].FindControl("ListBox1"); Controls[]的序号该怎么去呢?谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Controls是列的意思,想做地几列的数据就给第几列的序号就可以了 SelectedIndexChanged 事件 里ListBox lb = (ListBox)Repeater2.Controls[0].FindControl("ListBox1");???如果你说的是ListBox 的SelectedIndexChanged 事件的话,sender 就是你要找的ListBox 了ListBox lbx = sender as ListBox; 追问一句,要是取同一个Control里的其他控件呢?比如Label lb = (Label)Repeater1.Controls[0].FindControl("Label1")Control[] 怎么取呢 应该是Repeater1.Items[i].FindControl而不是Repeater1.Controls[0].FindControl如果你想在listbox 的SelectedIndexChanged事件里 找同一格内的其它控件可以如下: ListBox lbx = sender as ListBox; Label lbl = lbx.Parent.FindControl("lbl") as Label; if (lbl != null) { lbl.Text = lbx.Text; } web.config动态修改节点问题 Repeater绑定数据后如何生成分组的数据,比较难这个问题。 分页显示的时候怎么得到记录的总条数? 高分求javascript函数,最好是.js文件,里面包括的函数越详尽越好! 200分,请共享你的数据访问层代码 iframe中的listbox问题 下载文件问题!求助各位大大,我弄了整晚了没有结果,大家帮帮我啊!!!! 初级问题 在DataList中加了个Button,请问如何响应Button的事件?? 请教:怎么实现让div只出现横向滚动条而纵向始终不出现? TreeView 中 CheckBox 的选中 一个关于刷新父页面的问题
ListBox lb = (ListBox)Repeater2.Controls[0].FindControl("ListBox1");???如果你说的是ListBox 的SelectedIndexChanged 事件的话,
sender 就是你要找的ListBox 了ListBox lbx = sender as ListBox;
比如Label lb = (Label)Repeater1.Controls[0].FindControl("Label1")Control[] 怎么取呢
Repeater1.Items[i].FindControl而不是
Repeater1.Controls[0].FindControl如果你想在listbox 的SelectedIndexChanged事件里 找同一格内的其它控件可以如下:
ListBox lbx = sender as ListBox;
Label lbl = lbx.Parent.FindControl("lbl") as Label;
if (lbl != null)
{
lbl.Text = lbx.Text;
}