套用模板页之后,如果要在内容页中查找某个控件,需要先找到模板页中的ContentPlaceHolder,在通过ContentPlaceHolder查找代码,如下:
LinkButton btn = this.Master.FindControl("ContentPlaceHolder1").FindControl("opSearch") as LinkButton;
btn.Visible = false;
套用模板页之后,如果要在内容页中查找某个控件,需要先找到模板页中的ContentPlaceHolder,在通过ContentPlaceHolder查找代码,如下:
LinkButton btn = this.Master.FindControl("ContentPlaceHolder1").FindControl("opSearch") as LinkButton;
btn.Visible = false;