ASP.NET中的事件冒泡 [英] Event Bubbling in ASP.NET

查看:84
本文介绍了ASP.NET中的事件冒泡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是ASP.net中的EVENT BUBBLING?

What is EVENT BUBBLING in ASP.net?

推荐答案

你好,



事件冒泡是数据绑定控件(Repeater,DataList和DataGrid)使用它来将子控件(在项模板中)引发的命令事件公开为顶级事件。虽然.NET Framework中的ASP.NET服务器控件使用事件冒泡来执行命令事件(事件数据类派生自CommandEventArgs的事件),但可以冒泡在服务器控件上定义的任何事件。







您可以在MSDN网站上找到更多信息,并点击链接:



http://msdn.microsoft.com/en-us/library/aa719644%28v=vs.71%29.aspx
Hello ,

Event bubbling is used by the data-bound controls (Repeater, DataList, and DataGrid) to expose command events raised by child controls (within item templates) as top-level events. While ASP.NET server controls in the .NET Framework use event bubbling for command events (events whose event data class derives from CommandEventArgs), any event defined on a server control can be bubbled.



You can find more information on MSDN site and for that follow the link:

http://msdn.microsoft.com/en-us/library/aa719644%28v=vs.71%29.aspx


< b>事件冒泡只是事件由子控件引发由父控件处理。示例:假设网格视图作为父控件,其中有多个子控件。右边可以有一列链接按钮。每个链接按钮都有点击事件。而不是为每个链接按钮编写事件例程,为父母编写一个例程处理子链接按钮事件的单击事件。< / b>
<b>Event Bubbling is nothing but events raised by child controls is handled by the parent control. Example: Suppose consider grid view as parent control in which there are several child controls.There can be a column of link buttons right.Each link button has click event.Instead of writing event routine for each link button write one routine for parent which will handle the click events of the child link button events.</b>


事件冒泡使事件能够从控件层次结构中更方便的位置引发,并允许附加事件处理程序到原始控件以及暴露冒泡事件的控件。
Event bubbling enables events to be raised from a more convenient location in the controls hierarchy and allows event handlers to be attached to the original control as well as to the control that exposes the bubbled event.


这篇关于ASP.NET中的事件冒泡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆