Can't call AjaxMethod in UserControl

  1. #1

    Can't call AjaxMethod in UserControl

    I have the following code that is a Usercontrol. This Usercontrol is placed in another panel. I won't know what the actual ID of this control will be from within the control. How do I properly reference the AjaxMethod Save in this case?

    <%@ Control Language="VB" AutoEventWireup="false" CodeFile="AgencyPanel.ascx.vb" Inherits="AgencyPanel" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
        
    <ext:Button ID="Button1" runat="server" Text="Submit">
        <Listeners>
            <Click Handler="Coolite.AjaxMethods.?.Save();" />
        </Listeners>
    </ext:Button>
  2. #2

    RE: Can't call AjaxMethod in UserControl

    Hi,

    For 0.7 version you should use in user control code-behind
    Button1.Listeners.Click.Handler = string.Concat("Coolite.AjaxMethods.", this.ClientID, ".Save();");
    *
  3. #3

    RE: Can't call AjaxMethod in UserControl

    That works. But how would I also add an EditMask and success/failure handling such as:

                <Listeners>
                    <Click Handler="Coolite.AjaxMethods.Save({
                                success: function(result) { 
                                    Ext.Msg.alert('Message', result); 
                                },
                                eventMask: {
                                    showMask: true,
                                    minDelay: 5000,
                                    msg: 'Saving...'
                                }
                            });" />
                </Listeners>
    Thanks.

Similar Threads

  1. Replies: 1
    Last Post: May 29, 2013, 6:00 PM
  2. [CLOSED] AjaxMethod call from popup window
    By alexp in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 23, 2010, 3:43 PM
  3. Replies: 6
    Last Post: Dec 04, 2009, 11:01 PM
  4. Treepanel Context Menu call AjaxMethod
    By signup in forum 1.x Help
    Replies: 0
    Last Post: Oct 12, 2009, 8:29 AM
  5. Response.Redirect during AjaxMethod call
    By Dgsoft.ru in forum 1.x Help
    Replies: 5
    Last Post: Jul 14, 2009, 7:01 AM

Posting Permissions