[CLOSED] AjaxMethod in Custom Server Control

  1. #1

    [CLOSED] AjaxMethod in Custom Server Control

    I've created a custom server control that subclasses Coolite.Ext.Web.TreePanel. My intent is to use AjaxMethods to populate AsyncTreeNodes, but it looks like ClientProxy's for the AjaxMethods aren't being created. I considered using Coolite.AjaxMethod.request(), but there doesn't appear to be a URL that I can pass since the controls are compiled into an assembly.

    Any ideas? Is there any workaround that allows AjaxMethods to be defined with a server control?

    Please let me know if posting source code would make my question any clearer.

    Thank you.

    Jon
  2. #2

    RE: [CLOSED] AjaxMethod in Custom Server Control

    Hi,

    At this moment AjaxMethod can be defined in Page or UserControl. Other places are not supported
  3. #3

    RE: [CLOSED] AjaxMethod in Custom Server Control

    OK. Are there any plans to include this feature in the 1.0 release?

    And just in case others are having a similar problem, here's one solution that isn't too bad:

        public class MyTreePanel : Coolite.Ext.Web.TreePanel
        {
            // ... etc ...
    
            public static TreeNodeCollection GetNodes(...)
            {
                var nodes = new TreeNodeCollection();
                // ... etc ...
    
                return nodes;
            }
        }
        public partial class class MyPage : System.Web.UI.Page
        {
            // ... etc ...
    
            [AjaxMethod]
    
            pubilc string GetNodes(...)
    
            {
    
                var nodes = MyTreePanel.GetNodes(...);
    
                return nodes.ToJson();
    
            }
    
        }
    Jon
    Last edited by geoffrey.mcgill; Aug 31, 2016 at 6:37 PM.
  4. #4
    7 Years and 4 mayor versions later still not included?

    http://forums.ext.net/showthread.php...Server-Control

Similar Threads

  1. Custom Server Control Textfield
    By m_bo in forum 1.x Help
    Replies: 3
    Last Post: Mar 30, 2012, 9:21 AM
  2. [CLOSED] Creating custom control on server side
    By AnulekhaK in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Feb 21, 2012, 10:15 AM
  3. Replies: 2
    Last Post: Jan 09, 2012, 7:18 AM
  4. [CLOSED] Create web server control (composite control)
    By mmmartins in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: May 13, 2011, 6:18 PM
  5. [CLOSED] [1.0] Accessing instance of store defined in custom server control
    By bryantharpe in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Jun 28, 2010, 6:29 PM

Posting Permissions