How To Access Control On Master Page From Content Page
It a common requirement that you have change the master page content from content page. For example you have welcome label control that is there in master page and you want to change the welcome message after user logged in from the content page. Same way there might be another requirement like you need to bind a menu from content page as per user logged in having rights. In such kind of case use find control() method to access control on master page from the content page.You can find any control of master page like grid view,repeater and other controls. Let’s take above scenario where you have a label called lblWelcome in your master page and you need to change welcome message from content so first we have to create a label in master page like following.
<asp:Label ID="lblWelcome" runat="server"></asp:Label>
protected void Page_Load(object sender, EventArgs e)
Label lblWelcome = Page.Master.FindControl("lblWelcome")
lblWelcome.Text = "Welome message from content page";