Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 899801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:16:57+00:00 2026-05-15T15:16:57+00:00

I was going through an article on event bubbling in asp.net and came to

  • 0

I was going through an article on event bubbling in asp.net and came to know that although it is possible to subscribe to the click event of a user control’s button from the containing page, “doing so would break some of the object oriented rules of encapsulation”. A better idea is to publish an event in the user control to allow any interested parties to handle the event.

My question is that exactly how does a direct subscription to the button’s click event from a containing page would break the object oriented rules of encapsulation?

Apologies if its a dumb question. 😐

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T15:16:58+00:00Added an answer on May 15, 2026 at 3:16 pm

    The Button is supposed to be encapsulated by the UserControl.

    If the Page binds directly to events on the button, then the page is now dependent on the inner workings of the UserControl.

    The Page should be consuming the UserControl, not the UserControl’s button. If the author of the UserControl later wants to remove the button and use some fancy new method of firing its “Submit” event, your page could be broken because the button may no longer exist.

    For that matter, if the owner of the UserControl decides in v1.1 to rename the button from btnSubmit to SubmissionButton, it could break your page, as well.

    Better to consume the UserControl and let it be concerned with its own inner workings.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been going through this excellent article http://msdn.microsoft.com/en-us/library/ms972976.aspx that says ViewState is not responsible
Hey I was just going through some article on XML, I came across the
After going through the article at http://geekexplains.blogspot.com/2008/06/diff-between-externalizable-and.html , i got to know Externalizable is
I was going through this article : http://www.ajaxline.com/32-tips-to-speed-up-your-mysql-queries at point#4 , it states :
Going through happstack-lite tutorial : we build functions that have return type of ServerPart
Going through some documentation on modifying CGImageRef data, I came across a strange example
While going through SWig generated wrappers, I find that the PInvokes don't have any
Going through this article class ThreadTest { static void Main() { Thread t =
I am going through the article on JSF LifeCycles . I have the following
I am going through condition variable article at following location http://software.intel.com/en-us/blogs/2010/10/01/condition-variable-support-in-intel-threading-building-blocks/ Here we have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.