//在HeaderTemplate中寻找Label1,默认为第0个
string s=((Label)Repeater1.Controls[0].FindControl("Label1")).Text;

//在FooterTemplate中寻找Label2,默认为最后一个
string s=((Label)Repeater1.Controls[Repeater1.Controls.Count - 1].FindControl("Label2")).Text;

最好在绑定了数据以后在查找这些控件,否则可能找不到(未验证)

posted on 2010-05-06 15:12  信封牛  阅读(2388)  评论(0编辑  收藏  举报