Why is the event bubbling and why not subscribe directly to the click event?

I looked through an article about event bubbles in asp.net and found out that although it is possible to subscribe to the click event of a user’s control button from the containing page, "this will break the part of the object-oriented encapsulation rules object." The best idea is to publish the event in a user control to allow any interested parties to handle the event.

My question is, how exactly does a direct subscription to the button click event from the contained page violate object-oriented encapsulation rules?

Apologizes if his dumb question .: |

Thank!

+5
source share
2

, UserControl.

, UserControl.

UserControl, UserControl. UserControl - "", , .

, UserControl v1.1 btnSubmit SubmissionButton, .

UserControl .

+3

, . click, ImageButton, LinkButton ..

, , , . , .

+3

All Articles