Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何从 Repeater 获取 c# 中的图像 ID?在这里,我使用中继器来显示图像。如何从代码隐藏中获取此图像 ID?谢谢
如果您对图像使用 asp.net Image 控件,则可以使用.FindControl例如:
.FindControl
Image findImg = (Image)myRepeater.items[x].FindControl("imgID");
.Items[x] 是其中 x 是特定 itemTemplate 实例的索引。索引从 0 开始。
您使用该ClientID物业。
ClientID