如何找到触发事件的中继器项?

发布于 2024-12-18 19:53:01 字数 336 浏览 0 评论 0原文

我的转发器结构是这样的

---------------------------------
| 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浅暮の光 2024-12-25 19:53:01

将 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...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文