Can explain Event bubbling in dotnet framework
Event bubbling in dotnet framework
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Can explain Event bubbling in dotnet framework
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Muhammad Imran AnsariRank #326 · 7.6K reputationPosted Jun 3, 2025, 3:43 AM EDT
Event bubbling in the .NET Framework refers to the process where an event raised by a child control is propagated up the control hierarchy to its parent controls, allowing them to handle the event.
It's commonly used in ASP.NET Web Forms and WPF for handling events like clicks or changes centrally at a parent level.
Example: In WPF, a
Buttonclick can bubble up to aGridorWindowif not handled.// MainWindow.xaml.cs using System.Windows; using System.Windows.Input; namespace EventBubblingDemo { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void StackPanel_MouseDown(object sender, MouseButtonEventArgs e) { MessageBox.Show("MouseDown event bubbled to StackPanel!"); } } }Good Luck!