Adsence750x90

Sunday, May 2, 2010

Find Master Page Content From Content Page ASP.Net

Find Master Page Content From Content Page

for example to find a Panel in the Master Page. we want to find the Panel from Content Page
// Casting Panel1 form MasterPage as Panel
Panel panel = (Panel)Master.FindControl("Panel1");
        if (panel != null)
        {
            panel.Style.Add(HtmlTextWriterStyle.BackgroundColor, "Red");
        }

No comments: