Dynamically loading UserControls at runtime - problem

  1. #1

    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.

    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
  2. #2
  3. #3

    Dynamically loading UserControls at runtime - problem

    Thanks Daniil,

    It may complex to re-write my main page to apply dynamically loading usercontrols (my application is in production now).

    So is there any others way to optimize the performance for the page when loading, rendering without dynamic usercontrols?

    Again, thanks you so much for quickly helps!

    dany4446!
  4. #4
  5. #5

    namically loading UserControls at runtime - problem

    Thanks Daniil

    dany4446

Similar Threads

  1. Unloading dynamically loaded UserControls
    By bright in forum 1.x Help
    Replies: 1
    Last Post: Mar 14, 2012, 6:37 PM
  2. Dynamically loading Store problem at runtime
    By marcelorosait in forum 1.x Help
    Replies: 14
    Last Post: Feb 14, 2012, 9:33 AM
  3. [CLOSED] Problem loading dynamically user constrols
    By pdcase in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jan 12, 2012, 6:10 PM
  4. Replies: 7
    Last Post: Oct 28, 2011, 4:25 PM
  5. Replies: 7
    Last Post: Jun 03, 2011, 9:18 PM

Tags for this Thread

Posting Permissions