FindControl查找控件

发布时间:2017-09-21编辑:佚名阅读(1542)

1.在母版页中,如果需要找母版页中的控件:

this.FindControl("控件ID");


2.在母版页中,如果需要找ContentPage的控件,可以用:

this.FindControl("ContentPlaceHolderID").FindControl("控件ID");


3.在ContentPage中,如果需要找母版页中的控件,可以直接调用:

this.Master.FindControl("控件ID");


4.在ContentPage中找自己页面里的控件,必须先通过找到母版页中的ContentPlaceHolder,然后再找其中的控件:

this.Master.FindControl("ContentPlaceHolderID").FindControl("控件ID");


  关键字:asp.netFindControl查找控件


鼓掌

0

正能量

0

1

呵呵

0


评论区