ASP.NET Repeater 头模板(HeaderTemplate)和FooterTemplate模板中查找控件
生活随笔
收集整理的這篇文章主要介紹了
ASP.NET Repeater 头模板(HeaderTemplate)和FooterTemplate模板中查找控件
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
//在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;
最好在綁定了數據以后在查找這些控件,否則可能找不到(未驗證)
轉載于:https://www.cnblogs.com/envelope/archive/2010/05/06/1728917.html
總結
以上是生活随笔為你收集整理的ASP.NET Repeater 头模板(HeaderTemplate)和FooterTemplate模板中查找控件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: DropdownList树
- 下一篇: Google搜索引擎的十大应用