c# - Listing all nested user controls from a master page on page load -
on page load there way enumerate nest user controls specific page load?
i'd able enumerate user controls implement interface, , call interface method controls before asp.net passes control thier page_load events.
the problem master page level, page in app loading, , each of them have random user control, , need type reference determine if implement interface, , call method.
does have ideas?
would work?
void processcontrols(control control) { if(control imyinterface) //whatever interface name { (control imyinterface).methodname(); } foreach(control child in control.controls) { processcontrols(child); } }
Comments
Post a Comment