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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -