[CLOSED] Loadind UserControls with DirectMethod dynamicly

  1. #1

    [CLOSED] Loadind UserControls with DirectMethod dynamicly

    https://examples2.ext.net/#/Loaders/...Direct_Method/
    In Examples above NONE was presented as scenario where usercontrol had DirectMethod.Is it possible to call a directmethod from usercontrol when its loaded at run time ?
    Last edited by Daniil; Feb 19, 2013 at 3:36 AM. Reason: [CLOSED]
  2. #2
    Can you kick things off by providing a simplified sample demonstrating as much of the scenario as possible?
    Geoffrey McGill
    Founder
  3. #3
    Quote Originally Posted by geoffrey.mcgill View Post
    Can you kick things off by providing a simplified sample demonstrating as much of the scenario as possible?
    Well in examples https://examples2.ext.net/#/Loaders/...Direct_Method/
    shows a way how to bring UserControls in main Form but it is not raising any events on UserControl it just string representation of usercontrol
    for ex.
    //user control
    <ext:Container runat="server" Layout="BorderLayout" Border="false" Padding="4">
        <Items>
            <ext:Panel runat="server" Region="West" Title="West" Split="true" Width="150" Collapsible="true"
                Icon="ApplicationSideExpand" />
            <ext:Panel runat="server" Region="Center" Title="Center" />
            <ext:Panel runat="server" Region="East" Title="East" Split="true" Width="150" Collapsible="true"
                Icon="ApplicationSideContract">
                <Items>
                    <ext:Button runat="server" Text="Get Server Time">
                        <Listeners>
                            <Click Handler="App.direct.getTime">
                            </Click>
                        </Listeners>
                    </ext:Button>
                </Items>
            </ext:Panel>
        </Items>
    </ext:Container>
    // main page calling
       [DirectMethod]
        public static string UserControl()
        {
            return ComponentLoader.ToConfig("~/UserCtr/Items.ascx");
    
        }
  4. #4
    Hello,

    ComponentLoader doesn't maintain a loaded user control during other requests.

    But to execute a user control's DirectMethod handler, a user control instance must be on a server. Otherwise, no a user control => no a DirectMethod handler.

    Personally, I would refer a generic handler (ASHX) or a web service (ASMX). This call won't require a user control instance.

Similar Threads

  1. How to dynamicly add a node to a TreePanel?
    By gmpd123 in forum 2.x Help
    Replies: 5
    Last Post: Jun 15, 2015, 2:51 PM
  2. Replies: 2
    Last Post: Oct 18, 2012, 8:05 AM
  3. [CLOSED] Need Help with DirectMethod and UserControls
    By naatye in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 31, 2012, 5:22 PM
  4. setting the RegEx property dynamicly!?!
    By bassel in forum 1.x Help
    Replies: 1
    Last Post: Jun 11, 2010, 12:07 PM
  5. [CLOSED] Create controls dynamicly
    By Ningdev in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jun 03, 2009, 6:59 AM

Posting Permissions