如何找到触发事件的中继器项?
我的转发器结构是这样的
---------------------------------
| Repeater |
---------------------------------
| Dropdownlist | Label |
---------------------------------
每个转发器项目都有一个下拉列表和一个标签。根据下拉列表中选择的值,我想调用后面代码中的方法来计算值并将其设置在标签中。
但我面临传统 SelectedIndexChanged 事件的问题。它没有告诉我父级或中继器项目。
My repeater structure is like this
---------------------------------
| Repeater |
---------------------------------
| Dropdownlist | Label |
---------------------------------
Every repeater item has a dropdownlist and a label. Based on the value selected in the dropdownlist, I would like to call a method in code behind to compute a value and set it in label.
But i'm facing a problem with the traditional SelectedIndexChanged event. It doesnt tell me the parent or repeater item.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将 selectedindexchaged 事件的发送者强制转换为控件。
找到它的父级...执行此操作,直到获得一个作为重复器项目的对象...
cast the sender of the selectedindexchaged event to a control.
find tis parent...do this until u get an object that is a repeater item...