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

RadAjaxManager OnRequestStart & OnResponseEnd aborted

4 Answers 301 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Mohamed Ramadan
Top achievements
Rank 1
Mohamed Ramadan asked on 25 Nov 2010, 04:06 PM
Dear Sir,

I have a problem with the following scenario:

I have nested user controls as following
<userControl1>
  <table runat="server" id="tblTimesheet">
    <tr>
      <td>
    <asp:Button runat="server" ID="btnSave" Text="Save"/> 
        <userControl2></userControl2>
      </td>
    </tr>
  </table>
</userControl1>

where
UserControl1:
- has RadAjaxLoadingPanel1 and has the RadAjaxManager defined as following:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
    ClientEvents-OnRequestStart="Timesheet_RequestStart"
    ClientEvents-OnResponseEnd="Timesheet_ResponseEnd">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btnSave">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="tblTimesheet"/>
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
 
<telerik:RadCodeBlock runat="server" ID="scriptBlock">
    <script type="text/javascript">
        var currentLoadingPanel = null;
        var currentUpdatedControl = null;
        function Timesheet_RequestStart(sender, args) {
            currentLoadingPanel = $find("<%= RadAjaxLoadingPanel1.ClientID %>");
            currentUpdatedControl = "<%= tblTimesheet.ClientID %>";
            //show the loading panel over the updated control
            currentLoadingPanel.show(currentUpdatedControl);
        }
        function Timesheet_ResponseEnd() {
            //hide the loading panel and clean up the global variables
            if (currentLoadingPanel != null)
                currentLoadingPanel.hide(currentUpdatedControl);
            currentUpdatedControl = null;
            currentLoadingPanel = null;
        }
   </script>
</telerik:RadCodeBlock>

UserControl2:

<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btnAddNewRow">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="tblTimesheetSection"/>
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
 
<table class="TimesheetSectionTable" runat="server" id="tblTimesheetSection">
</table>
<asp:Button runat="server" ID="btnAddNewRow" Text="Add New"/>


Now the scenario is:
- When you open the form for first time and click on btnAddNewRow on UserControl2. ClientEvents-OnRequestStart is working fine and show the loading panel on all the form.
- Use btnSave on UserControl1. ClientEvents-OnRequestStart is working fine and show the loading panel on all the form.
- After Form return. click on btnAddNewRow on UserControl2. Form is sending Ajax request but ClientEvents-OnRequestStart is not triggered any more from the nested control so the loading panel not appears.
- Use btnSave on UserControl1. ClientEvents-OnRequestStart is working fine and show the loading panel on all the form.


I tried to add the following code to the page load of UserControl2. but that didn't help :(
Dim manager As RadAjaxManager = RadAjaxManager.GetCurrent(Page)
manager.ClientEvents.OnRequestStart = "Timesheet_RequestStart"
manager.ClientEvents.OnResponseEnd = "Timesheet_ResponseEnd"

Thanks,
Mohamed Ramadan

4 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 29 Nov 2010, 12:30 PM
Hi Mohamed,

I would suggest you to set the Ajax settings in UserControls2 by using the main RadAjaxManager instead of using RadAjaxManagerProxy and add the ajax settings programmatically  in PageLoad event of the control.
Test this approach and let me know if this makes any difference.

Sincerely yours,
Maria Ilieva
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
RvdGrint
Top achievements
Rank 1
answered on 31 May 2011, 02:39 PM
Maria,

I've the same problem and adding settings programmatically to the AjaxManager has no effect.
Other suggestions?
0
Maria Ilieva
Telerik team
answered on 01 Jun 2011, 02:35 PM
Hello Jos,

It will be very helpful if you could elaborate a bit more on your application and post some part of your markup and the related code behind. Thus we will be able to review it locally and do our bets to isolate the root cause of the issue you are facing and provide proper solution.

Best wishes,
Maria Ilieva
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
RvdGrint
Top achievements
Rank 1
answered on 03 Jun 2011, 07:28 AM
Maria,

I solved the problem. I used UpdatPanels for partitial update of my WebApplication. I've placed the RadAjaxManager inside the outermost UpdatePanel. When adding a UserControl in my case the outermost UpdatPanel is refreshed and after placing the RadAjaxManager inside that panel the problem was solved.

At this moment'I'm replacing the UpdatePanels with RadAjaxPanels wiich makes the use of the RadAjaxManger not necessary anymore.

Thnx for you're response anyway.

Regards,
  Jos Meerkerk
Tags
Ajax
Asked by
Mohamed Ramadan
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
RvdGrint
Top achievements
Rank 1
Share this question
or