[CLOSED] Nested MasterPage with DirectMethod

  1. #1

    [CLOSED] Nested MasterPage with DirectMethod

    I have a master page that is using another master page (which is, itself using a master page). When I call
    #{DirectMethods}.Whatever()
    from the nested master, it's looking for
    Ext.net.DirectMethods.ct100.Whatever()
    , but the actual direct method is at
    Ext.net.DirectMethods.ct100_ct100_ct100.Whatever()
    What should I do?
    Last edited by Daniil; May 09, 2012 at 8:28 PM. Reason: Please use [CODE] tags, [CLOSED]
  2. #2
    Hi,

    Confirmed, there is a problem to reference a DirectMerthod in such case. Here is the example to reproduce.

    We will investigate.

    Example MasterPage
    <%@ Master Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <asp:ContentPlaceHolder ID="ContentPlaceHolderMaster" runat="server" />
        </form>
    </body>
    </html>
    Example Nested MasterPage
    <%@ Master Language="C#" MasterPageFile="~/Master.Master"  %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        [DirectMethod]
        public void TestDirectMethod()
        {
            X.Msg.Alert("DirectMethod", "Hello from server!").Show();
        }
    </script>
    
    <asp:Content runat="server" ContentPlaceHolderID="ContentPlaceHolderMaster">
    
        <asp:ContentPlaceHolder ID="ContentPlaceHolderMasterNested" runat="server" />
    
        <ext:Button runat="server" Text="Call DirectMethod">
            <Listeners>
                <Click Handler="#{DirectMethods}.TestDirectMethod();" />
            </Listeners>
        </ext:Button>
    
    </asp:Content>
    Example Content Page
    <%@ Page Language="C#" MasterPageFile="~/MasterNested.Master" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <asp:Content runat="server" ContentPlaceHolderID="ContentPlaceHolderMasterNested">
        Click the Button
    </asp:Content>
  3. #3
    I forgot that there is the DirectMethodProxyID attribute for such cases.

    You can set up
    [DirectMethodProxyID(IDMode = DirectMethodProxyIDMode.Alias, Alias = "MasterNested")]
    attribute for MasterNested page and call its DirectMethod this way.
    Ext.net.DirectMethods.MasterNested.TestDirectMerthod();
    See also
    https://examples1.ext.net/#/Events/D...thods/ID_Mode/
  4. #4
    Quote Originally Posted by Daniil View Post
    I forgot that there is the DirectMethodProxyID attribute for such cases.

    You can set up
    [DirectMethodProxyID(IDMode = DirectMethodProxyIDMode.Alias, Alias = "MasterNested")]
    attribute for MasterNested page and call its DirectMethod this way.
    Ext.net.DirectMethods.MasterNested.TestDirectMerthod();
    See also
    https://examples1.ext.net/#/Events/D...thods/ID_Mode/
    I don't think I can used named parameters in vb... this is the closes thing i could come up with using intellisense, but it says that there are too many arguments to the constructor...

    <DirectMethodProxyID("Whatever", DirectMethodProxyIDMode.Alias)>
    How would I use this in vb.net?
  5. #5
    It should be like this
    <DirectMethodProxyID(IDMode := DirectMethodProxyIDMode.[Alias], [Alias] := "MasterNested")> _
    Public Class TestClass
    
    
    End Class
  6. #6
    This worked. Thanks!

Similar Threads

  1. [CLOSED] DirectMethod call from page contained in a masterpage
    By egvt in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: May 18, 2012, 5:36 PM
  2. [CLOSED] Nested data in nested grids
    By FAS in forum 1.x Legacy Premium Help
    Replies: 16
    Last Post: Apr 19, 2012, 7:51 PM
  3. [CLOSED] Masterpage and BorderLayout
    By Justin_Wignall in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 11, 2011, 11:36 AM
  4. [CLOSED] Ext. Control with MasterPage
    By sisa in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 08, 2011, 4:15 PM
  5. [CLOSED] Difference between DirectMethod , DirectEvent, Static DirectMethod
    By syllabusarq in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 01, 2011, 11:37 AM

Tags for this Thread

Posting Permissions