[CLOSED] Static DirectMethod and Dynamic Window (created from code behind)

  1. #1

    [CLOSED] Static DirectMethod and Dynamic Window (created from code behind)

    Hi,

    I am able to add an alert from code behind, but I am not able to create and show a dynamic window using a static directmethod.

    Bellow is the code to reproduce.

    Thanks

    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
     
    <script runat="server">
        [DirectMethod]
        public static void UserPoints()
        {
            X.Msg.Alert("1", "2").Show();
    
            var window = new Window {ID = "window1"};
            window.Show();
            window.Render();
        }
     
    </script>
     
    <!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 id="Head1" runat="server">
        <title>ComboBox with show/hide of custom FieldTrigger - Ext.NET Examples</title>
    </head>
    <body>
        <form id="Form1" runat="server">
            <ext:ResourceManager  runat="server" />
            <ext:DisplayField  runat="server">
                <Listeners>
                    <BeforeRender Handler="#{DirectMethods}.UserPoints({ eventMask : { showMask : false }, failure: function (errorMsg) {} });" />
                </Listeners>
            </ext:DisplayField>
        </form>
    </body>
    </html>
    Last edited by Daniil; Nov 16, 2012 at 2:11 PM. Reason: [CLOSED]
  2. #2
    It is fixed in v2
    In v1 you have to register script manually in static direct method

    Use the following code instead Render method calling
    Ext.Net.ResourceManager.AddInstanceScript(window.ToScript());
  3. #3
    Thanks.

    Solved the problemo ;)

Similar Threads

  1. [CLOSED] Dropdownfield with a window created from code behind
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 23, 2012, 6:30 PM
  2. Window doesn't show when created from code behind.
    By eosalalima in forum 2.x Help
    Replies: 3
    Last Post: Apr 11, 2012, 6:22 AM
  3. [CLOSED] Window Created in Code Behind does not show
    By sisa in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 09, 2011, 2:13 PM
  4. Replies: 13
    Last Post: May 16, 2011, 1:26 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

Posting Permissions