遍历ASP.Net页面的某个控件

来源:互联网 发布:无法加入emule网络 编辑:程序博客网 时间:2024/05/19 17:03
foreach (System.Web.UI.Control ctl in this.Controls)              {                 if (ctl.GetType() == typeof(ImageButton))                    {                        if (i < dt.Rows.Count)                        {                            ImageButton pImg = (ImageButton)ctl;                            pImg.ImageUrl = Page.ResolveUrl("~" + dt.Rows[i]["SimpleImgUrl"].ToString());                            i++;                         }                     }              }


原创粉丝点击