[CLOSED] DirectMethod in customcontrol error

  1. #1

    [CLOSED] DirectMethod in customcontrol error

    I'm getting an error when putting a directmethod in a custom control as described in http://forums.ext.net/showthread.php?15060.
    The procedure worked for another control, but this one is causing an error in Ext.Net.ResourceManager.RaisePostBackEvent saying "The control with ID 'ctl00_HelpWindowViewer' not found", where ctl00_HelpWindowViewer is the id of the control where the directmethod is placed in. If i place the same directmethod in the page and remove the control id from the call it works fine. I'm calling the directmethod like this:

                var loadRecords = eval("Ext.net.DirectMethods." + this.id + ".HelpViewer_LoadRecords");
                            
                loadRecords(...);
    It's hard to make an example due to the complexity of the custom control and it's database interactions. Only having the place where the error occurs and the message, do you have any hint on what may be causing it?
    Last edited by Daniil; Jun 26, 2012 at 10:23 PM. Reason: [CLOSED]
  2. #2
    If you create simple custom control with direct method only then is the issue reproducible?
    Where you register direct method (at which page life cycle step)?
    Is your control is dynamic or static (defined in markup)?
    If dynamic then where you recreate it (Page_Init or Page_Load or somewhere else)
  3. #3
  4. #4
    Forgot to say, the custom control uses javascript class where the directmethod is called, like:

    HelpViewer = Ext.extend(Ext.Panel, {
    ...
      loadRecords: function() {
                var loadRecords = eval("Ext.net.DirectMethods." + this.id + ".HelpViewer_LoadRecords");                        
                loadRecords(...);
      }
    ...
    }
  5. #5
    I am a little bit confused by 'ctl00', may be on next requests the autogenerated id is another
    Try to set IDMode="Static" for your custom control

    By the way, the following construction is not effective
    var loadRecords = eval("Ext.net.DirectMethods." + this.id + ".HelpViewer_LoadRecords");                  loadRecords(...);
    It is better to use
    Ext.net.DirectMethods[this.id].HelpViewer_LoadRecords(...);
  6. #6
    'ctl00' is autogenerated, i guess it is because of the masterpage.
    If i use static id i get the same error, without the ctl00 "The control with ID 'HelpWindowViewer' not found".
  7. #7
    Well, unfortunatelly, i have no ideas, try to reproduce it on simple sample. Do you able to find that custom control via FindControl method during ajax request?
  8. #8
    In fact the control that has the directmethod is placed inside another custom control that is actually in the master page.. Could it be it? Since the control is not directly added to the aspx it's not being able to raise it's postback event?
  9. #9
    Do you add directmethod control to Controls collection of that another custom control?
    If yes then where?

Similar Threads

  1. Replies: 2
    Last Post: Jan 14, 2011, 5:51 PM
  2. [CLOSED] Error when processing DirectMethod on TreePanel
    By ewgoforth in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 26, 2010, 8:41 AM
  3. [CLOSED] DirectMethod Grid Editor error
    By rthiney in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 21, 2010, 2:02 PM
  4. Replies: 2
    Last Post: Mar 02, 2010, 1:50 AM
  5. CustomControl inhertis Coolite Panel & AjaxMethods
    By monkey.nhu in forum 1.x Help
    Replies: 2
    Last Post: Sep 24, 2009, 8:32 AM

Posting Permissions