[CLOSED] [1.0] ComponentDirectEvent exception with dynamically loaded controls

  1. #1

    [CLOSED] [1.0] ComponentDirectEvent exception with dynamically loaded controls

    We are having problems with all DirectEvents when loading controls dynamically. We have attached an VS 2010 project with an simple page loading an UserControl with just an Panel and an Button. The Button has an DirectEvents.Click event that just makes an alert but we get the following error when clicking the button.

    Server Error in '/' Application.
    The control with ID 'ctl02_ctl02' 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 'ctl02_ctl02' not found
    Source Error: 
    Line 2505:                    if (ctrl == null)
    Line 2506:                    {
    Line 2507:                        throw new HttpException("The control with ID '{0}' not found".FormatWith(controlID));
    Line 2508:                    }
    Line 2509:                }
    
    Source File:C:\Projects\Coolite.net\Ext.Net\Core\ResourceManager\ResourceManager.cs    Line:2507 
    Stack Trace: 
    [HttpException (0x80004005): The control with ID 'ctl02_ctl02' not found]
       Ext.Net.ResourceManager.RaisePostBackEvent(String eventArgument) in C:\Projects\Coolite.net\Ext.Net\Core\ResourceManager\ResourceManager.cs:2507
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +176
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5019
    
    Version Information: Microsoft .NET Framework Version:4.0.30128; ASP.NET Version:4.0.30128.1
  2. #2

    RE: [CLOSED] [1.0] ComponentDirectEvent exception with dynamically loaded controls

    We used the latest version of coolite from svn downloaded the 10 feb.
  3. #3

    RE: [CLOSED] [1.0] ComponentDirectEvent exception with dynamically loaded controls

    Hi,

    You have to recreate dynamic controls for each request to handle DirectEvents. Otherwise ResourceManager cannot find that button and its handler. So, remove 'if(!X.IsAjaxRequest)'

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. [CLOSED] Managing events from a dynamically loaded UserControl
    By egvt in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 20, 2012, 4:49 PM
  3. [CLOSED] Dynamically loaded pages issue in Chrome and Firefox
    By bakardi in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Dec 08, 2011, 6:24 PM
  4. Replies: 2
    Last Post: Dec 08, 2011, 1:00 PM
  5. Replies: 3
    Last Post: Mar 30, 2010, 1:03 PM

Posting Permissions