How will you access a TextBox contains in a Master Pages from Content Page?

 Posted by Akiii on 5/5/2012 | Category: ASP.NET Interview questions | Views: 1357 | Points: 40

We can access master page controls from the content pages.For examples :-

TextBox txtbx = (TextBox)Master.FindControl("txtMaster");

txtbx .Text = "DotnetFunda";

In the above code, FindControl is a method which is taking name of the control which is in the master page. Then it is casting in the textbox. Now, with the help of the text property we can assign any property.

Thanks and Regards

| Alert Moderator 

Comments or Responses

Login to post response