Ajax Event Confirmation Tag

  1. #1

    Ajax Event Confirmation Tag

    Greetings.

    I have a problem with the confirmation tag for a button's ajax event. The confirmation box appears, but when you click "Yes" to confirm, I receive the following exception in a client-side popup window:

    [NullReferenceException: Object reference not set to an instance of an object.]
       Coolite.Ext.Web.ScriptManager.FireAsyncEvent(String eventName, ParameterCollection extraParams) +109
    Coolite.Ext.Web.ScriptManager.RaisePostBackEvent(String eventArgument) +2138
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
    Here is my button:
    <ext:Button ID="btnCancel" Enabled="true" IconCls="icon-cancel" Text="Cancel" runat="server">
          <AjaxEvents>
                <Click OnEvent="btnCancel_Click" Success="storeActiveTasks.load(); btnCancel.disable();">
                        <Confirmation ConfirmRequest="true" Title="Confirmation" Message="Cancel this task?"/>  
                </Click>
          </AjaxEvents>
    </ext:Button>
    Any thoughts on what could be wrong? All the other events in my page work just fine, so I don't believe there's an issue with the script manager; however, the stack trace seems to hint otherwise.

    Notes:
    - I am using a master page.
    - If I remove the confirmation tag, the ajax event works just fine.

    Thanks,
    -Koz
  2. #2

    RE: Ajax Event Confirmation Tag

    Hi,

    Can you show full example which reproduces the error? I can't reproduce the exception therefore I need your sample
    *
  3. #3

    RE: Ajax Event Confirmation Tag

    Hmmm, I won't be able to post the whole thing, but I will try to come up with a smaller example for you.

    Thanks.
  4. #4

    RE: Ajax Event Confirmation Tag

    k, I tried to come up with as simple of an example as I could, but still maintain similar code-paths as my actual application, and I still receive an error.


    Master Page:

    <%@ Master Language="VB" AutoEventWireup="false" CodeBehind="StandardPageMaster.master.vb" Inherits="TestCooliteConfirm.StandardPageMaster" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    <!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 runat="server">
        <title>Untitled Page</title>
    </head>
    <body id="MasterBody">
        <form id="form1" runat="server">
        <ext:ScriptManager ID="extScriptMgr" runat="server" IDMode="Static"></ext:ScriptManager>
        
        <asp:ContentPlaceHolder ID="body" runat="server">     
        </asp:ContentPlaceHolder>
        </form>
    </body>
    </html>
    And a form:

    frmMain.aspx
    <%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/StandardPageMaster.Master" CodeBehind="frmMain.aspx.vb" Inherits="TestCooliteConfirm.frmMain" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
        <ext:Panel>
            <TopBar>
                <ext:Toolbar runat="server">
                    <Items>
                          <ext:Button ID="btnCancel" Enabled="true" IconCls="icon-cancel" Text="Cancel" runat="server">
                                <AjaxEvents>
                                    <Click OnEvent="btnCancel_Click">
                                         <Confirmation ConfirmRequest="true" Title="Confirmation" Message="Are you sure you want to delete this task?" />
                                         <EventMask Msg="Cancelling..." ShowMask="true" MinDelay="500" />                   
                                    </Click>                    
                                </AjaxEvents>
                            </ext:Button>
                    
                    </Items>
                </ext:Toolbar>
            
            </TopBar>
        </ext:Panel>
    
    </asp:Content>
    frmMain.aspx.vb
    Imports Coolite.Ext.Web
    
    Partial Public Class frmMain
        Inherits System.Web.UI.Page
    
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    
        End Sub
    
    
        <Coolite.Ext.Web.AjaxMethod()> _
       Public Sub btnCancel_Click(ByVal sender As Object, ByVal e As AjaxEventArgs)
            If Debugger.IsAttached Then Debugger.Break()
        End Sub
    End Class

    With this setup, I get an exception when I click the "Cancel" button.
    However, if I remove the Confirmation Tag from the event, it works as expected.

    Thanks again.
    -akozmic


  5. #5

    RE: Ajax Event Confirmation Tag

    Hi,

    For me your sample works fine. What version do you use?


    P.S. AjaxMethod attribute is not required for AajxEvent handler
  6. #6

    RE: Ajax Event Confirmation Tag

    *The assembly shows:* 0.8.0.15573

    Thanks.
  7. #7

    RE: Ajax Event Confirmation Tag

    FIXED: We upgraded our coolite dlls this afternoon, and the problem no longer exists.

    Thanks for your help!

Similar Threads

  1. Replies: 13
    Last Post: Jun 09, 2011, 12:36 PM
  2. ajax event confirmation
    By [WP]joju in forum 1.x Help
    Replies: 2
    Last Post: Dec 10, 2009, 6:17 AM
  3. ajax event success
    By [WP]joju in forum 1.x Help
    Replies: 3
    Last Post: Dec 10, 2009, 5:27 AM
  4. [CLOSED] Before event of a ajax event.
    By Riset in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 27, 2009, 12:07 PM
  5. ajax event problem
    By snoutoz in forum 1.x Help
    Replies: 10
    Last Post: Mar 04, 2009, 6:08 PM

Posting Permissions