Is there any way to access controls on the Master Page without using FindControl() method ?

 Posted by Bharathi Cherukuri on 7/31/2012 | Category: ASP.NET Interview questions | Views: 3261 | Points: 40
Answer:

Yes, You can access controls on the Master Page by casting the Master to your MasterPage as shown below:


protected void Page_Load(object sender, EventArgs e)
{
MyMasterPage MMP = this.Master;
MMP.MyTextBox.Text = "Text Box Found";
}


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response