AjaxRequest not firing after Ok button

5 posts, 0 answers
  1. Matthew
    Matthew avatar
    25 posts
    Member since:
    Aug 2011

    Posted 13 Oct 2012 Link to this post

    I have a RibbonBar button that when click a RadWindowManager.RadConfirm window opens up. After the "Ok" button is 
    click the RadAjaxManager1_AjaxRequest in the code behind is not being fired. However, the javascript is being fired
    and returns no errors

    the HTML markup and javascript is setup as follows:

    <%@ Control Language="vb" AutoEventWireup="false" CodeBehind="DailyReportsControl.ascx.vb" Inherits="FXWB.DailyReportsControl" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            //<![CDATA[
            function alertCallBackFn(arg) {
                return false;
            }
     
            function confirmCallBackFn(arg) {
                var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
                if (arg != null) {
                    //If user confirms they want to clear all signatures, call server side method   
                    if (arg == true) {
                        if (ajaxManager != null) {
                            ajaxManager.ajaxRequest(1);
                            return false;
                        }
                    }
                    //If user cancels the clear all signatures, then simply return   
                    else if (arg == false) {
                        if (ajaxManager != null) {
                            return false;
                        }
                    }
                }
            }
            //]]>                                                                        
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    </telerik:RadWindowManager>
    

    The code-behind loads up other controls dynamically on the page (there is another page identical to this one and the AjaxRequest is firing on that one).
    The code-behind for the Request is as follows:

        Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As ObjectByVal e As Telerik.Web.UI.AjaxRequestEventArgsHandles RadAjaxManager1.AjaxRequest
            Select Case e.Argument
                Case "1"
                    MyBase.OnDelete(ucFolderList.ListType, ucFolderList.ucFolderControl.objFolder.strFolderType, ucFolderList.SelectedItems)
                    MyBase.OnDelete(ucSubfolders.ListType, ucSubfolders.ucFolderControl.objFolder.strFolderType, ucSubfolders.SelectedItems)
                    Response.Redirect(Request.Url.ToString())
            End Select
        End Sub
    


    Why is the RadAjaxManager1_AjaxRequest not firing after the confirm button click?
     
  2. Matthew
    Matthew avatar
    25 posts
    Member since:
    Aug 2011

    Posted 15 Oct 2012 Link to this post

    Does anyone have any ideas on this issue?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 16 Oct 2012 Link to this post

    Hi Matthew,

    Let me start with noting that it is better to post your questions in the most relevant section. In this case your actual problem is related to the RadAjaxManager and not to the RadWindow.

    WIth only a few snippets I can only be guessing but here is a list of ideas that can be helpful:
    - is this a default document and is RadCompression enabled. If so - this can be caused by a known breaking change in .NET related to default documents and event handlers. You can find more information on that here.
    - you do not have AJAX settings in the manager. They are required for its functioning. In this case the initiator must be the manager itself and you need to add proper updated controls
    - try getting the reference to the manager as shown here
    - you cannot redirect during an AJAX request, read more about it here

    All the best,
    Marin Bratanov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  5. Matthew
    Matthew avatar
    25 posts
    Member since:
    Aug 2011

    Posted 16 Oct 2012 Link to this post

    Hi Marin,

    1. Default Document? No, this is a UserControl that is loaded into a base aspx page that is used throughout the application.
    2. Ajax Settings, The same functionality works in other UserControls without Ajax Settings, would it be possible that it is required sometimes and not all the time?
    3. Redirect with Ajax Request, this is an incorrect statement as there are other instances of the same with Response.Redirect that are working correctly
  6. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 17 Oct 2012 Link to this post

    Hello Matthew,

    With this information I cannot say where the problem originates. I advise that you open a new support ticket and send us a small, runnable sample that shows the problem so we can investigate the case.


    All the best,
    Marin Bratanov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017