每个 Web 控件是否只有一个不是从 System.Web.UI.WebControls 继承的唯一事件?
我想知道这一点的原因是因为似乎 __doPostBack('controlId','eventarg')
引发指定控件的唯一事件,但我想知道如果该控件有多个唯一事件会发生什么。
The reason I want to know this is because it seems that __doPostBack('controlId','eventarg')
raises the unique event of the control specified, but I wonder what would happen if the control had multiple unique events.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它实际上会导致调用控件通过 IPostBackEventHandler 接口。然后控件可以检查参数并引发适当的事件。某些控件将忽略该参数并仅引发 Click,但在 GridView 上,它可能会触发 PageIndexChanging、Sorting 或 SelectedIndexChanging 等事件。
It actually causes a call to the
RaisePostBackEvent
method which the control exposes through the IPostBackEventHandler interface. The control can then check the argument and raise an appropriate event. Some controls will ignore the argument and just raise Click, but on GridView it could trigger events like PageIndexChanging, Sorting, or SelectedIndexChanging.