ASP.NET MasterPages: ajax instance method 'xxx' is absent

Page 1 of 2 12 LastLast
  1. #1

    ASP.NET MasterPages: ajax instance method 'xxx' is absent

    Hi, I'm using Ext.Net 2.2 and my Direct methods can be called without no problem using App.direct.methodname on certain
    pages but in other pages which inherit the same MasterPage that contains the DirectMethod the following error will display
    even though when I type on the console App.direct.xxx the methods are there:

    Message: The ajax instance method 'mymethodname' is absent!
    Any ideas?
    Thanks
  2. #2
    Please post test sample reproduces the issue
    Vladimir Shcheglov
    Sr. Developer
  3. #3
    Quote Originally Posted by Vladimir View Post
    Please post test sample reproduces the issue
    Master:
    [DirectMethod]
        public static void myMethod()
        {
            X.Msg.Notify("myMethod", DateTime.Now.ToString());
        }
    Child Page:
    ScriptManager.RegisterStartupScript(this, this.GetType(), "test", "App.direct.ctl00.myMethod(); setInterval(function(){ App.direct.ctl00.myMethod(); }, 30000);", true);
    Last edited by paul-2011; Sep 10, 2013 at 7:27 PM.
  4. #4
    correction:
    App.direct.ctl00.myMethod()
    displays:
    System.Exception: The static DirectMethod '' has not been defined. at Ext.Net.DirectRequestModule.ProcessRequest(HttpApp lication app, HttpRequest request)
  5. #5
    Static method cannot be defined in master page (only in content page)
    Try to remove static
    Vladimir Shcheglov
    Sr. Developer
  6. #6
    Quote Originally Posted by Vladimir View Post
    Static method cannot be defined in master page (only in content page)
    Try to remove static
    done that and no go, no errors but function doesn't get triggered, I always had DirectMethods working since version 1.4, not sure what I'm missing here.
  7. #7
    Please post runable test case
    Vladimir Shcheglov
    Sr. Developer
  8. #8
    Quote Originally Posted by Vladimir View Post
    Please post runable test case
    but how can I post a master page + child page runable content here?
  9. #9
    Just post text of master and child page here
    Vladimir Shcheglov
    Sr. Developer
  10. #10
    Quote Originally Posted by Vladimir View Post
    Just post text of master and child page here
    Here it is:

    Master
    <%@ Master Language="C#" %>
    
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    
    <!DOCTYPE html>
    
    
    <script runat="server">
        [DirectMethod]
        public void myMethod()
        {
            X.MessageBox.Notify("Test", DateTime.Now.ToString()).Show();
        }
    </script>
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <asp:ContentPlaceHolder id="head" runat="server">
        </asp:ContentPlaceHolder>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <h1>Master</h1>
            <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
            
            </asp:ContentPlaceHolder>
        </div>
        </form>
    </body>
    </html>
    Child

    <%@ Page Title="" Language="C#" MasterPageFile="~/SampleMaster.master" %>
    
    
    <script runat="server">
    
    
    </script>
    
    
    <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
        <h2>Child</h2>
        <a href="#" onclick="App.direct.myMethod()">Run</a>
    </asp:Content>
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] GridPanel Layout with Masterpages
    By sisa in forum 1.x Premium Help
    Replies: 6
    Last Post: Aug 18, 2012, 2:00 PM
  2. [CLOSED] Problem with Page.X() and masterpages
    By Pablo_Azevedo in forum 1.x Premium Help
    Replies: 4
    Last Post: Jun 08, 2012, 8:32 PM
  3. [CLOSED] ViewState and MasterPages
    By wisdomchuck in forum 1.x Premium Help
    Replies: 1
    Last Post: May 20, 2011, 8:58 PM
  4. Problem With editor in MasterPages & User web Control
    By firebird_design in forum 1.x Help
    Replies: 2
    Last Post: Sep 08, 2010, 2:57 PM
  5. [CLOSED] FitLayout & masterpages
    By GmServizi in forum 1.x Premium Help
    Replies: 5
    Last Post: Oct 22, 2009, 7:11 AM

Tags for this Thread

Posting Permissions