[CLOSED] DirectMethod and UserControl

  1. #1

    [CLOSED] DirectMethod and UserControl

    When using a DirectMethod within a UserControl, do I have to reference it differently than Ext.net.DirectMethods.MyMethod? The same code works when it's alone on a page, but in the UserControl, I get a javascript error saying that MyMethod is not a property of Ext.net.DirectMethods.
  2. #2

    RE: [CLOSED] DirectMethod and UserControl

    Hi,

    The following sample from the Examples Explorer should help solve the problem, see


    https://examples1.ext.net/#/Events/D.../UserControls/


    Geoffrey McGill
    Founder
  3. #3

    RE: [CLOSED] DirectMethod and UserControl

    I'm trying to call the DirectMethod from a javascript function. Interestingly enough, the following works and I don't see it mentioned in the examples, so it's making me scared. :)

    	Ext.net.DirectMethods.<%= Me.ClientID %>.MyMethod(...
  4. #4

    RE: [CLOSED] DirectMethod and UserControl

    Hi,

    Yes, correctly, you have to use ClientID of user control (by default)
    Also you can use DirectMethodProxyID attribute like in the following example
    https://examples1.ext.net/#/Events/D...thods/ID_Mode/

    Or use the following shortcut
    #{DirectMethods}.MyMethod();
    It is mean direct methods of the current scope (for example, if you call it in the user control then will be called MyMethod which is defined in that user control)
  5. #5

    RE: [CLOSED] DirectMethod and UserControl

    jmcantrell (6/21/2010)I'm trying to call the DirectMethod from a javascript function. Interestingly enough, the following works and I don't see it mentioned in the examples, so it's making me scared. :)

    Ext.net.DirectMethods.<%= Me.ClientID %>.MyMethod(...

    Actually, your code is demonstrated in the second "Calling UserControl [DirectMethod] from Parent .aspx Page" sample.


    In the sample we use a custom client-side namespace (ie, CompanyX), which replaces the "Ext.net.DirectMethods" bit. And instead of dynamically rendering the UserControl ClientID, we're just hard coding.




    Geoffrey McGill
    Founder

Similar Threads

  1. Help me dont work UserControl directmethod. plz
    By SeoNamseok in forum 2.x Help
    Replies: 0
    Last Post: Jul 09, 2012, 8:19 AM
  2. [CLOSED] DirectMethod: UserControl in a Layer not working
    By nhg_itd in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 20, 2012, 2:12 AM
  3. [CLOSED] DirectMethod with UserControl Problem
    By nhg_itd in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 21, 2011, 8:00 AM
  4. [CLOSED] [1.0] DirectMethod - Page . UserControl . UserControl
    By Patrick in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 25, 2010, 9:33 AM
  5. [CLOSED] XRender UserControl DirectMethod
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Jan 22, 2010, 1:03 PM

Posting Permissions