我添加控件动态为占位符,其内的ContentPlaceHolder如何在ContentPlaceholder和占位符中查找控件?
var t = (ContentPlaceHolder)Master.FindControl("ContentPlaceHolder1");
var t1 = (PlaceHolder)mpContentPlaceHolder.FindControl("PlaceHolderName");
var t2 = (DropDownList)t1.FindControl("ControlID");
它看起来像我失去了一些东西,因为T2总是空
'mpContentPlaceHolder'实际上应该是't'吗?另外,确保你没有在'(!IsPostBack)'块中添加控件。 – Brad 2010-09-23 18:58:19