This is a migrated thread and some comments may be shown as answers.

AjaxRequest not firing after Ok button

4 Answers 180 Views
Window
This is a migrated thread and some comments may be shown as answers.
Matthew
Top achievements
Rank 1
Matthew asked on 13 Oct 2012, 04:22 PM
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?
 

4 Answers, 1 is accepted

Sort by
0
Matthew
Top achievements
Rank 1
answered on 15 Oct 2012, 09:32 PM
Does anyone have any ideas on this issue?
0
Marin Bratanov
Telerik team
answered on 16 Oct 2012, 12:21 PM
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.
0
Matthew
Top achievements
Rank 1
answered on 16 Oct 2012, 02:35 PM
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
0
Marin Bratanov
Telerik team
answered on 17 Oct 2012, 12:21 PM
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.
Tags
Window
Asked by
Matthew
Top achievements
Rank 1
Answers by
Matthew
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or