CallBackFnName fire before click at Ok button

2 posts, 0 answers
  1. Paulo Goncalves
    Paulo Goncalves avatar
    26 posts
    Member since:
    Aug 2004

    Posted 08 May 2013 Link to this post

    This code work before upgrade from 2012.3.1016.40 to 2013.1.417.40. Now the RadAjaxManager1_AjaxRequest fired before I click at Ok button. When click at 'Button1' the request is fired. I rerturn to 2012.3.1016.40 and the problem continue. Any idea ?

    Default.aspx
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="cPanel_Default" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <head runat="server">
        <title></title>
    </head>
     
    <body>
        <form id="form1" runat="server">
        <div>
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            </telerik:RadScriptManager>
     
            <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
                <script type="text/javascript">
                    function confirmCallBackFn(arg) {
                        var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
                        ajaxManager.ajaxRequest(arg);
                        return false;
                    }
                </script>
            </telerik:RadCodeBlock>
     
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="Button1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
     
            <telerik:RadWindowManager ID="RadWindowsManager1" runat="server" Title="Editar" Behaviors="Close,Move" VisibleStatusbar="false" style="z-index:90000" EnableEmbeddedSkins="false" ShowContentDuringLoad="true" ReloadOnShow="true" DestroyOnClose="true" >
            </telerik:RadWindowManager>
     
            <asp:button ID="Button1" runat="server" text="Button" />
        </div>
        </form>
    </body>
    </html>

    Default.aspx.vb
    Partial Class cPanel_Default
        Inherits System.Web.UI.Page
     
        Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
     
            RadWindowsManager1.RadConfirm("Callback ?", "confirmCallBackFn('Ok')", 300, 120, Nothing, "Test")
     
        End Sub
     
        Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
     
            If e.Argument = "Ok" Then Button1.Text = e.Argument
     
        End Sub
    End Class

    Thanks
    Paulo
  2. Paulo Goncalves
    Paulo Goncalves avatar
    26 posts
    Member since:
    Aug 2004

    Posted 09 May 2013 Link to this post

    Hi, the problem is fixed.

    To reuse the JS functions, I create an agument at callback function, the RadWindow don´t return error and execute callback function before click at Ok button.

    Te correct call is:
    RadWindowsManager1.RadConfirm("Callback ?", "confirmCallBackFn", 300, 120, Nothing, "Test")

    and I need one callbackfunction to each radconfirm
    .

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top