runtime error: 'Ext.net.DirectMethods' is null or not an object

  1. #1

    runtime error: 'Ext.net.DirectMethods' is null or not an object

    I upgrade my project from ext.net version 1.0 to version 2.3. my page DocumentListpage.aspx has master page. ext:ResourceManager tag is in master page. DirectMethods is defined in DocumentListpage.aspx. when I run the DocumentListpage and click 'Search' button. it suppose to run DirectMethods, but I got Javascript runtime error: 'Ext.net.DirectMethods' is null or not an object.
    Here are partial code in masterpage:
    <form id="form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
         <Listeners>
                <DocumentReady Handler="fristLoad=true;Ext.getDoc().on('keydown', function (e) {if (e.getKey() == e.ENTER) {DoSearch(#{cmbDocTypes}.getValue());}});" />             
            </Listeners>
        <asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server">
        </asp:ContentPlaceHolder>
    Here are DocumentListpage server side code for search:
    [DirectMethod]
            public void SearchAction(string searchCondition, int docTypeID)
            {
                try
                {
                    List<DocumentKeywordItem> seachValues = CooliteUIHelper.ParseSearchFormPanelSubmitValues(docTypeID, searchCondition);
    
                     
                    this.tabMain.Loader.Url = "DocGridList.aspx";
    
                    this.tabMain.Loader.Params.Clear();
    
                    this.tabMain.Loader.Params.Add(new Ext.Net.Parameter("doctypeid", docTypeID.ToString()));
                    this.tabMain.Loader.Params.Add(new Ext.Net.Parameter("isquery", "1"));
    
                    foreach (DocumentKeywordItem seachValue in seachValues)
                    {
                        if (string.IsNullOrEmpty(seachValue.KeywordValue))
                            continue;
    
                        this.tabMain.Loader.Params.Add(new Ext.Net.Parameter(seachValue.KeywordName, seachValue.KeywordValue));
                    }
    
                    this.tabMain.LoadContent();
                     
                }
                catch (Exception ex)
                {
                    string strmsg = "Error in DocumentListPage::SearchAction: " + ex.Message;
                    ErrorLog.WriteErrorLog(strmsg, Application["ErrorFile"].ToString());
                }
    
            }
    here are patial code in DocumentListPage client side code:
    function DoSearch(fpanel,id) {  
                 var formval = App['ff'+id].getForm().getValues(true); 
                  SearchForm(formval,id);
            }
    
            function SearchForm(formValues, doctypeid) {
                Ext.net.DirectMethods.SearchAction(Ext.encode(formValues).toString(), doctypeid, {
                    success: function(result) {
                    },
                    failure: function(msg) {
                        Ext.Msg.alert('Failure', msg);
                    },
                    eventMask: {
                        showMask: true
                    }
                });
            }
    <ext:FormPanel ID="Tab1" Frame="true" runat="server" Title="Keywords" Layout="card"
                                    ActiveIndex="0" ButtonAlign="Right" AutoHeight="true">
                                    <Items>
                                        <ext:Panel ID="pnlNull" runat="server" Html="No document type" Border="false" Header="false" />
                                    </Items>
                                    <Buttons>
                                        <ext:Button ID="Button1" runat="server" Text="Search" >
                                            <Listeners>
                                                <Click Handler="DoSearch(#{ff1},#{cmbDocTypes}.getValue());" />
                                            </Listeners>
                                        </ext:Button>
                                        <ext:Button ID="Button2" runat="server" Text="Reset">
                                            <Listeners>
                                                <Click Handler="ResetSearchForm(#{cmbDocTypes}.getValue());" />
                                            </Listeners>
                                        </ext:Button>
                                    </Buttons>
                                </ext:FormPanel>
    Last edited by Holly; Nov 08, 2013 at 1:15 PM.
  2. #2
    You have to use App.direct, please see
    https://examples2.ext.net/#/Events/D...hods/Overview/
  3. #3

    App.direct works

    Thanks. App.direct works.

    Quote Originally Posted by Vladimir View Post
    You have to use App.direct, please see
    https://examples2.ext.net/#/Events/D...hods/Overview/

Similar Threads

  1. Replies: 1
    Last Post: Sep 22, 2012, 8:08 PM
  2. Replies: 3
    Last Post: Mar 04, 2011, 11:08 AM
  3. Replies: 0
    Last Post: Mar 04, 2011, 10:52 AM
  4. Replies: 2
    Last Post: Mar 12, 2010, 8:33 AM
  5. Replies: 0
    Last Post: Aug 27, 2009, 6:13 PM

Posting Permissions