Calling Direct Method from client side .js

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Calling Direct Method from client side .js

    Hello again,

    sorry for persisting on the subject.
    In our current Ext.Net 3 architecture we rely heavily on calling Direct Methods from client JS functions.
    I appreciate the Direct Event example provided above, but what interest us is what is the equivalent of adding a [Direct Method] attribute to a function in order to make it accessible in the App.Direct client side namespace?

    We basically use Web Forms in its most basic format, executing ASP.NET code only in the Page_Load method. Everything else happens in [Direct Method] functions. So, essentially, we do not use [Direct Events] which require binding to specific DOM Components.
    In a similar approach, can we have code execute server side without having to use a Direct Event but rather call a Direct Method as per below?

    Client Side:
    function do_register() {
    
      App.direct.Register(
                          {
                            success: function (result) {
                              if (result) {
                                close_register();
                              }
                            },
                            eventMask: { showMask: true, msg: App.WAIT },
                            failure: function (errorMsg) { Ext.Msg.alert(App.PROBLEM, errorMsg); }
                          });
    }

    Server side:

    [DirectMethod]
      public bool Register()
      {
         //some code
         return false;
      }
    Thank you very much for your time.
    Kind regards.
    Last edited by AnFil; Nov 01, 2020 at 5:51 PM. Reason: Typo

Similar Threads

  1. Replies: 3
    Last Post: Aug 03, 2015, 4:59 PM
  2. Replies: 0
    Last Post: Jun 07, 2013, 11:24 AM
  3. Replies: 0
    Last Post: Mar 08, 2012, 9:45 AM
  4. Success function in calling Direct Method..help!
    By Aleksa007 in forum 1.x Help
    Replies: 2
    Last Post: Jul 26, 2011, 4:36 PM
  5. Replies: 2
    Last Post: Apr 27, 2011, 2:58 PM

Posting Permissions