User control access to control on MatserPage

Posted on 2009-04-17
Last Modified: 2013-12-17
Greetings all

I have a MasterPage which contains a Label control and a UserControl.

The Label Control's value is set through whichever content page is loaded - that is working.

What I need to do is for the usercontrol (which is displayed via an AJAX ModalPopup) to read that value and process based on that.

Any thoughts?

In advance, thanks!

Question by:allanmark
    LVL 9

    Accepted Solution

    see the link below. It gives you an idea how to access Methods/Properties on masterpage

    Assisted Solution

    Here is how you can do this:
    We write this code in the User Control's code behind.
    Label Lbl = (Label)Page.Master.FindControl("SomeLabelControl");

    Now we can use this Label object tot access the Lbl.Text property get its value and start using it.

    Author Closing Comment

    Many thanks!!

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now