跳过中继器的 ItemDataBound 事件
有没有办法可以跳过中继器的 ItemDataBound 事件,例如在事件中使用 e.Handled = true
。我知道 RepeaterItemEventArgs 不包含 Handled 属性。
实际上,我想在数据列表的数据绑定事件中绑定中继器,因为中继器的绑定事件被调用两次。因此,在第二次调用 ItemDataBound 事件时,我想跳过该事件。
Is there a way I can skip ItemDataBound event of the repeater like using e.Handled = true
inside the event. I know RepeaterItemEventArgs does not contain a Handled property.
Actually I want to bind repeater inside a datalist's databound event due to which repeater's bound event is called twice. So on second call of the ItemDataBound event I want to skip the event.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
存储一个布尔标志,其默认值为 true,并且在您的事件中您应该有如下内容:
Store a boolean flag which will have a default value of true and inside your event you should have something like this: