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 3854862
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:41:16+00:00 2026-05-19T17:41:16+00:00

In my ASP.NET app I have a control in the master page that raises

  • 0

In my ASP.NET app I have a control in the master page that raises an event Foo on certain occasions / interactions.

I also have a couple of pages that have another control that must re-bind itself when this event is fired.

Unfortunately the only way I can see them communicating between each other is by creating a long event chain (deriving a new MasterPage MasterPageSuperDuper, attaching an event handler to Foo‘s event in the user control, and then referring to this event in the masterpage from the control present in a couple of pages – basically using the masterpage as a control center).

Is it possible to raise an event the page control can see without getting the masterpage involved?

  • 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-19T17:41:17+00:00Added an answer on May 19, 2026 at 5:41 pm

    Here we go.

    Create an Interface, put in app_code folder

    public interface IBinder
    {
        void Bind();
    }
    

    PageControl Implement Interface

    public partial class WebUserControl2 : System.Web.UI.UserControl, IBinder
    {
        protected void Page_Load(object sender, EventArgs e)
        {
    
        }
    
        public void Bind()
        {
        }
    }
    

    In your Control on the masterpage

    public partial class WebUserControl1 : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
    
        }
        protected void butRaiseEvent_Click(object sender, EventArgs e)
        {
            CheckSub(this.Parent.Parent.Controls);
        }
    
        private void CheckSub(ControlCollection cc)
        {
            foreach (Control c in cc)
            {
                if (c is IBinder)
                    ((IBinder)c).Bind();
                else
                    CheckSub(c.Controls);
            }
        }
    }
    

    Let me know if it works.

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

Sidebar

Related Questions

I have an asp.net/C# app that uses subversion for source control. My app automatically
I have a linkbutton in a gridview control in my asp.net app that generates
I have a FormView control in an ASP.NET 2.0 app. I've got the database
I have an ASP.NET app that sits on our intranet, using the WindowsIdentity to
I have an asp.net app that uses System.IO.Path.GetTempFileName() for temporary files. In the production
I have a asp.net vb.net app, with a upload file control, when i upload
I have a reporting module in an ASP.NET webforms app (C#) that uses dynamic
I have a Page in ASP.net and UserControl that I register in this page.
Using .NET 4.0, I have a small ASP.NET app that utilized the ReportViewer object,
Good day, I have a ASP.net MVC app that needs to upload files to

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.