[CLOSED] Question about DirectMethod/DirectEvents call

  1. #1

    [CLOSED] Question about DirectMethod/DirectEvents call

    Hello

    Until now I called my DirectMethod/Events in th e code behind of the page, fore example, from Default.aspc to Default.aspx.cs.

    I wonder if it is possible to make such a call to another page or to a dll in an external class?

    For example today I do that

    
     <DirectEvents>
         <BeforeShow OnEvent="CreateAboutWindow" Timeout="300000"></BeforeShow>
     </DirectEvents>
    Is it possible to replace by something like that :

    
     <DirectEvents>
          <BeforeShow OnEvent="MyClass.CreateAboutWindow" Timeout="300000"></BeforeShow>
     </DirectEvents>
    And same thing for a directMethod?
    Last edited by fabricio.murta; Aug 07, 2015 at 6:37 AM. Reason: [CLOSED]
  2. #2
    Hello @feanor91!

    No, as for Direct Methods and events, it will not work. The direct methods/events are registered as App.direct.<method_name> during page load, and remote classes are not mapped there, even if they are public and static.

    But from the direct methods you can instantiate and call those remote classes (including in different assemblies).

    Not really directMethod, but still you can use AJAX requests that, if the class is set up to handle such requests, you will able to. One example of such is using AJAX Proxy to get a result from a MVC controller.

    If you have some experience with MVC, for example if you look at the TreePanel with Ajax Proxy MVC example, you'll see that, although not in webforms format, the TreeStore's URL points to "GetChildren" action address.

    If you're not much acquainted to MVC, what this 'action address' does is essentially access the same address with '/GetChildren' appended to it. While the example's address is:
    http://mvc.ext.net/#/TreePanel_Loaders/Proxy/

    It will just query the address:
    http://mvc.ext.net/#/TreePanel_Loade...xy/GetChildren

    For the data to load in the store. If you open this second address, you'll see the json-encoded data that is shown on the tree.

    I hope this helps, although diverted significantly from the original question.
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hi,

    You just confirmed what I thought...Ext.Net is magic but magic has to stop somewhere :)

    Thanks

Similar Threads

  1. [CLOSED] Strange question about directmethod call
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 8
    Last Post: Nov 12, 2012, 12:37 PM
  2. [CLOSED] Call Javascript function after or from DirectEvents
    By zwf in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 31, 2012, 6:06 PM
  3. DirectEvents and WebApi json request call
    By Pyropace in forum 2.x Help
    Replies: 4
    Last Post: Sep 05, 2012, 11:42 PM
  4. Replies: 0
    Last Post: Jun 06, 2012, 7:38 PM
  5. [CLOSED] DirectEvents call method codebehind
    By rnfigueira in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Sep 05, 2011, 3:03 PM

Posting Permissions