[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


User control access to control on MatserPage

Posted on 2009-04-17
Medium Priority
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

Accepted Solution

tetorvik earned 500 total points
ID: 24170765
see the link below. It gives you an idea how to access Methods/Properties on masterpage

Assisted Solution

sushantkulkarni earned 500 total points
ID: 24170937
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

ID: 31571588
Many thanks!!

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Integration Management Part 2
Suggested Courses

834 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