Adding controls with an ajax event

  1. #1

    Adding controls with an ajax event

    Hello,

    I'm trying to add a DesktopWindow (or any other control) dynamically in an ajax event like this :


            <StartMenu>
                <Items>
                    <ext:MenuItem runat="server" Text="All" Icon="Folder">
                        <Menu>
                            <ext:Menu runat="server">
                                <Items>
                                    <ext:MenuItem runat="server" Text="Test" Icon="Information">
                                        <AjaxEvents>
                                            <Click OnEvent="TestEvent" />
                                        </AjaxEvents>
                                    </ext:MenuItem>
                                </Items>
                            </ext:Menu>
                        </Menu>
                    </ext:MenuItem>
                    <ext:MenuSeparator runat="server" />
                </Items>
            </StartMenu>

            protected void TestEvent(object sender, AjaxEventArgs e)
    
    
    
    
            {
                var win = new DesktopWindow()
                {
                    Title = "test",
                    Page = this
                };
    
    
                this.Form.Controls.Add(win);
    
    
                win.Show();
            }

    I'm not getting any errors but the window never appears, any ideas?
  2. #2

    RE: Adding controls with an ajax event

    Not sure, but dynamic component add is not supported in version before 1.0.
    So if you are using v8.1 and I'm right you can't do this.
    You can try to write some js to deal with it.

Similar Threads

  1. [CLOSED] create controls in ajax event
    By matejgolob in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jun 21, 2011, 7:42 PM
  2. [CLOSED] Adding menu items with Ajax Event
    By gokcemutlu in forum 1.x Legacy Premium Help
    Replies: 13
    Last Post: Apr 21, 2011, 10:07 AM
  3. Replies: 0
    Last Post: Oct 17, 2010, 3:20 PM
  4. Adding Controls in Code Behind Causes Event Error
    By niceguymattx in forum 1.x Help
    Replies: 2
    Last Post: May 21, 2010, 9:49 AM
  5. [CLOSED] Adding controls in Ajax Event
    By SFritsche in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 13, 2009, 9:56 PM

Posting Permissions