7 February 2014

Access master page controls from content page?



Sometimes we need to access the master page controls in content pages, see the below sample code how to access master page control from content page.

Label lblName = (Label)Master.FindControl("lblUsername");
lblName.Text = "Test Name";

No comments:

Post a Comment