c# - How to find PlaceHolder controls from User Control -
i have 2 usercontrol name called uc_1 & uc_2.
in uc_1 have 1 placeholder. refer placeholder uc_2.
i tried below codes getting null error:
string usercontrolname = "uc_1.ascx"; system.web.ui.usercontrol usercontrol = null; placeholder objplaceholder = ((timereportuc)page.findcontrol("placeholderid")).findcontrol("placeholderid") placeholder; usercontrol = (system.web.ui.usercontrol)page.loadcontrol(usercontrolname); objplaceholder.controls.add(usercontrol);
Comments
Post a Comment