In ASP.NET 2.0 Master Pages, if you want to FindControl inside a content page, you can use the following:
In the BaseClass of your aspx pages in ASP.NET, add the following:
protected Control FindPageControl(string ControlName, string ContentHolderName)
{
// Get the ContentPlaceHolder Control
ContentPlaceHolder _CPH = (ContentPlaceHolder)this.Page.Controls[0].FindControl(ContentHolderName);
// Get the required control inside ContentPlaceHolder control
Control _ctrl = _CPH.FindControl(ControlName);
return _ctrl;
}
In your aspx page, you can find the control as follows:
Contributor
4057 Points
8649 Posts
MVP
FindPageControl :: Get Control Inside a Content Page
Sep 02, 2005 08:33 AM|haidar_bilal|LINK
In ASP.NET 2.0 Master Pages, if you want to FindControl inside a content page, you can use the following:
In the BaseClass of your aspx pages in ASP.NET, add the following:
In your aspx page, you can find the control as follows:
Where "chkDays" is a CheckBoxList of days.
Hope that helps,
Check original post @: FindPageControl :: Get Control inside a content page
Regards
Professional ASP.NET 3.5 Security, Membership, and Role Management with C# and VB