[CLOSED] Why direct methods are not working? Ext.net v2.5

  1. #1

    [CLOSED] Why direct methods are not working? Ext.net v2.5

    We have a User Control that has a "Save" button. When pressing the button the system should ask the user for a name and then call a Direct Method to actually perform the saving.

    The code below doesn't work and I need your help. After the dialog window, the system doesn't call the DirectMethod:

    <ext:Button ID="ButtonSaveSettings" runat="server" Icon="Disk" Text="Save" IconAlign="Top" >
                        <Listeners>
                            <Click Handler="Ext.Msg.prompt('Please name your new Screener', 'Screener Name:', function (buttonId, text) { #{DirectMethods}.Screener_Save_Name(buttonId, text); });" />
                        </Listeners>                
    </ext:Button>
    Last edited by Daniil; Jul 14, 2015 at 5:12 PM. Reason: [CLOSED]
  2. #2

    I found the problem and fixed it. Here is the data.

    To those users who encounter this problem often - Make sure that your handler sends the correct parameters and types.

    Here is the code that works:

    User Control Code:
                    <ext:Button ID="ButtonSaveSettings" runat="server" Icon="Disk" Text="Save" IconAlign="Top" >
                        <Listeners>
                            <Click Handler="Ext.Msg.prompt( 'Please name your new Screener', 'Screener Name:', 
                                                                { apply: function(obj,args) 
                                                                                    { 
                                                                                        if (args[0]=='ok') { 
                                                                                            #{DirectMethods}.Screener_Save_Name(args[1]); 
                                                                                        }
                                                                                    }});" />
                        </Listeners>                
                    </ext:Button>
    CODE BEHIND:
    [DirectMethod]
            public void Screener_Save_Name(string ScreenerName)
            {
               ....
            }

Similar Threads

  1. Replies: 2
    Last Post: Dec 02, 2015, 3:26 PM
  2. Replies: 3
    Last Post: Apr 01, 2015, 7:36 PM
  3. Direct Methods and Custom Control
    By Zdenek in forum 1.x Help
    Replies: 0
    Last Post: Apr 19, 2012, 10:18 PM
  4. [CLOSED] Common Direct Methods
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 25, 2011, 5:54 AM
  5. Are direct methods same as WebMethod
    By deeptechtons in forum 1.x Help
    Replies: 2
    Last Post: Dec 27, 2010, 3:31 AM

Posting Permissions