Jan 30, 2012, 9:25 AM
Dynamically loading UserControls at runtime - problem
Hi all,
My main page contains a lot of usercontrols (controls on each usercontrol are a bit of complex) so I embedded all of those usercontrols to my main page at design time. When loading the main page, it takes a long time - about 20 seconds.
I have tried to load those usercontrols dynamically at runtime to optimize the performance - the loading is much faster now. But I got errors occur when clicking on usercontrols' buttons.
Do you have any advices for my complex main page (contains a lot of usercontrols)??
Thanks so much!
dany4446
My main page contains a lot of usercontrols (controls on each usercontrol are a bit of complex) so I embedded all of those usercontrols to my main page at design time. When loading the main page, it takes a long time - about 20 seconds.
I have tried to load those usercontrols dynamically at runtime to optimize the performance - the loading is much faster now. But I got errors occur when clicking on usercontrols' buttons.
The control with ID 'ctl36_btnSave' not found
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The control with ID 'ctl36_btnSave' not found
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Could you please let me know why? Is there any problem with usercontrol's events when using dynamic usercontrol?Do you have any advices for my complex main page (contains a lot of usercontrols)??
Thanks so much!
dany4446
Last edited by geoffrey.mcgill; Jan 30, 2012 at 10:43 AM.
Reason: please use [CODE] tags