Display individual RadAjaxLoadingPanel while more than one controls are loading


Good Afternoon
I am trying to use RadAjax to create many SharePoint WebParts that each reach out to remote datasources, databind then display thier data. I am encountering an problem displaying individual loading panels while these controls perform thier initial load (This can be lengthy, many seconds apiece).
The behviour I am looking for is to have individual RadAjaxUpdatePanels presented while each control is loading. I've followed the example outlined here (http: www.telerik.com assist aspnet-ajax ajxshowloadingpaneloninitialpageload.html) and this works quite well, provided that not more than one instance of the webpart appears on a given page or any other webpart that impliments this solution.
Attached to this solution is a simplified version of the WebPart logic that substitudes the databinding with a
System.Threading.Thread.Sleep call to imitate the call to an external resource.
When more than one instance of the same part that impliments this login is present on a page, only the call back seems to occure, by this I mean that at the same instance (after the prescribbed delay) the callback renders both webparts simultainiously.
When instances of various WebParts implimenting this logic are on a given page, only the second callback appears to occure and only the last webpart is rendered after the prescribed delay.
I hope that this is enough to make the problem clear enough to address. Given below is the source of the WebPart in it is entirety;
MyWeek WebPart Code snippet
MyWeekPart.cs


usingSystem;


usingSystem.Text;


usingSystem.collections.Generic;


usingSystem.Web;


usingSystem.Web.UI;


usingSystem.Web.UI.WebControls;


usingSystem.Web.UI.WebControls.WebParts;


usingMicrosoft.Practices.SPG.Common.Logging;


usingMicrosoft.Practices.SPG.Common.ServiceLocation;


usingTelerik.Web.UI;


usingNipissingU.Portal.Common.ExceptionHandling;


usingNipissingU.Portal.Common.Entities;


usingNipissingU.Portal.Colleague.Repositories;


usingNipissingU.Portal.Common.Application;





namespaceNipissingU.Portal.WebPart.MyWeek


{


publicclassMyWeekPart:Microsoft.SharePoint.WebPartPages.WebPart


{


#regionFields...


privateControlmyWeekControl;


privatePanelPanel1;


privatePanelPanel2;


privateRadAjaxLoadingPanelRadAjaxLoadingPanel1;





#endregion





#regionProperties...


IErrorVisualizerErrorVisualizer{get;set;}


#endregion








#regionOverriddenMethods...


protectedoverridevoidOnInit(EventArgse)


{


base.OnInit(e);





ScriptManagerscriptManager=ScriptManager.GetCurrent(this.Page);


if(scriptManager==null)


{


scriptManager=newRadScriptManager();


this.Page.Form.Controls.AddAt(0,scriptManager);


}





Page.clientScript.RegisterStartupScript(typeof(MyWeekPart),this.ID,"_spOriginalFormAction=document.forms[0].action;_spSuppressFormOnSubmitWrapper=true;",true);


if(this.Page.Form =null)


{


stringformOnSubmitAtt=this.Page.Form.Attributes["onsubmit"];


if( string.IsNullOrEmpty(formOnSubmitAtt)&&formOnSubmitAtt=="return_spFormOnSubmitWrapper();")


{


this.Page.Form.Attributes["onsubmit"]="_spFormOnSubmitWrapper();";


}


}


}





protectedoverridevoidOnLoad(EventArgse)


{


base.OnLoad(e);





ErrorVisualizererrorVisualizer=newErrorVisualizer();


this.ErrorVisualizer=errorVisualizer;





try


{


this.Controls.add(errorVisualizer);





LoadtheUserControlTemplatefromthe TEMPLATE CONTROLTEMPLATESdirectory.


myWeekControl=Page.LoadControl(" _controltemplates NipissingU MyWeekControl.ascx");





AddtheLoadedcontroltotheWebPartsControlcollection.Thisisimportantto


establishtheChildControlEvents


errorVisualizer.Controls.add(myWeekControl);





Panel1=myWeekControl.FindControl("Panel1")asPanel;


Panel2=Panel1.FindControl("Panel2")asPanel;


RadAjaxLoadingPanel1=myWeekControl.FindControl("RadAjaxLoadingPanel1")asRadAjaxLoadingPanel;





RadAjaxManagerAjaxManager1=RadAjaxManager.GetCurrent(this.Page);


if(AjaxManager1==null)


{


AjaxManager1=newRadAjaxManager();


AjaxManager1.ID="RadAjaxManager1";


Controls.add(AjaxManager1);


this.Page.items.add(typeof(RadAjaxManager),AjaxManager1);


}





AjaxManager1.AjaxRequest+=newRadAjaxControl.AjaxRequestDelegate(MyWeekPart_AjaxRequest);


}


catch(Exceptionex)


{


newViewExceptionHandler().HandleViewException(ex,this.ErrorVisualizer,


Constants.FriendlyError);


}


}





protectedoverridevoidOnPreRender(EventArgse)


{


base.OnPreRender(e);





if( this.CheckForWebPartDisplayMode(WebPartManager.BrowseDisplayMode))


{


newViewExceptionHandler().ShowfunctionalErrorMessage(Constants.DisplayModeError,this.ErrorVisualizer);


}


}


#endregion





#regionEvents...


protectedvoidMyWeekPart_AjaxRequest(Objectsender,Telerik.Web.UI.AjaxRequestEventArgse)


{


try


{


if(e.Argument=="MyWeekLoad")


{


System.Threading.Thread.Sleep(2000);


Panel2.Visible=true;





LabelLabel2=newLabel();


Label2.Text=e.Argument;


Panel2.Controls.add(Label2);


}


}


catch(Exceptionex)


{





}


}


#endregion





#regionPrivateMethods...


protectedboolCheckForWebPartDisplayMode(WebPartDisplayModemode)


{


boolflag=false;


if((base.WebPartManager =null)&&(base.WebPartManager.DisplayMode==mode))


{


flag=true;


}


returnflag;


}


#endregion


}


}




Constants.cs


usingSystem;





namespaceNipissingU.Portal.WebPart.MyWeek


{


publicstaticclassConstants


{


publicstaticstringFriendlyError="MyWeekiscurrentlyunavailable.Pleasetryagainlater.";


publicstaticstringDisplayModeError="Thepageisineditmode.Toshowthecontentsofthiswebpart,closethetoolbarorrefreshthewebpart.";


}


}




MyWeekControl.aspx


< @ControlLanguage="C#"AutoEventWireup="true"Inherits="NipissingU.Portal.WebPart.MyWeek.MyWeekControl,NipissingU.Portal.WebPart.MyWeek,Version=1.0.0.0,Culture=neutral,PublicKeyToken=fc876b2c4bf21e29" >


< @RegisterTagPrefix="telerik"Namespace="Telerik.Web.UI"Assembly="Telerik.Web.UI,Version=2009.3.1314.35,Culture=neutral,PublicKeyToken=121fae78165ba3d4" >





<telerik:RadScriptBlockID="RadScriptBlock1"runat="server">


<scripttype="text javascript">


functionaddLoadEvent(func)


{


varoldonload=window.onload;


if(typeofwindow.onload ='function')


{


window.onload=func;


}


else


{


window.onload=function(){


if(oldonload)


{


oldonload();


}


func();


}


}


}





functionMyWeek_OnLoad()


{


setTimeout(function(){window["< =RadAjaxManager.GetCurrent(this.Page).clientID >"].ajaxRequest("MyWeekLoad");},50);


}





addLoadEvent(MyWeek_OnLoad);


script>


telerik:RadScriptBlock>





<styletype="text css">


.module1


{


background-color:#dff3ff;


border:1pxsolid#c6e1f2;


}


style>





<telerik:RadAjaxManagerProxyID="AjaxManagerProxy1"runat="server">


<AjaxSettings>


<telerik:AjaxSettingAjaxControlID="Panel1">


<UpdatedControls>


<telerik:AjaxUpdatedControlControlID="Panel1"LoadingPanelID="RadAjaxLoadingPanel1" >


UpdatedControls>


telerik:AjaxSetting>


<telerik:AjaxSettingAjaxControlID="RadAjaxManager1">


<UpdatedControls>


<telerik:AjaxUpdatedControlControlID="Panel1"LoadingPanelID="RadAjaxLoadingPanel1" >


UpdatedControls>


telerik:AjaxSetting>


AjaxSettings>


telerik:RadAjaxManagerProxy>





<fieldsetclass="module1">


<asp:PanelID="Panel1"runat="server"HorizontalAlign="Center"Height="150px">


<asp:PanelID="Panel2"runat="server"Visible="False">


<asp:ButtonID="Button1"runat="server"Text="Clicktoseetheloadingimage"OnClick="Button1_Click"


Style="margin-top:15px;margin-left:15px" >


<br >


<asp:LabelID="Label1"runat="server"Text="BeforeAjax...">asp:Label>


asp:Panel>


asp:Panel>


fieldset>





<telerik:RadAjaxLoadingPanelID="RadAjaxLoadingPanel1"runat="server">


<divalign="center"class="nu-loadingpanel-container">


<divclass="dt-bigthrobber"> div>


<div>Loading...div>


div>


telerik:RadAjaxLoadingPanel>







MyWeekControl.cs


usingSystem;


usingSystem.Data;


usingSystem.Configuration;


usingSystem.collections;


usingSystem.Web;


usingSystem.Web.Security;


usingSystem.Web.UI;


usingSystem.Web.UI.WebControls;


usingSystem.Web.UI.WebControls.WebParts;


usingSystem.Web.UI.HtmlControls;


usingTelerik.Web.UI;





namespaceNipissingU.Portal.WebPart.MyWeek


{


publicpartialclassMyWeekControl:System.Web.UI.UserControl


{


#regionFields...


protectedLabelLabel1;


protectedPanelPanel1;


protectedButtonButton1;


protectedRadAjaxLoadingPanelRadAjaxLoadingPanel1;


#endregion





protectedvoidButton1_Click(Objectsender,EventArgse)


{


System.Threading.Thread.Sleep(2000);


Label1.Text=DateTime.Now.ToLongTimeString();


}


}


}




Christian, Christian,
To overcome this behavior u can set the RadAjaxPanel RadAjaxManager RequestQueueSize property as described here,so it handles the more than one requests.
All the best,
Pavlina
the Telerik team
Do u need to have ur say when we set our development plans Do u need to know when a function u care about is added or when a error fixed Explore the Telerik Public Problem tracking system and vote to affect the priority of the items

View Complete with Replies


RELATED TOPICS OF Ajax Control PROGRAMMING LANGUAGE




how to show the question in my form page - Ajax Forum - ASP.NET Controls

I have a forgot password form page. in this page I'm asking user to enter his mail id. and after that on the basis of his mail id i want to show his security question  as a next field in the same page.  after answering that question he can generate his new password
VIEWS ON THIS POST

10

Posted on:
Thursday, September 20, 2012
View Replies !

RadAjaxLoadingPanel not show when inside content page - Ajax Forum - ASP.NET Controls

Hello
It seems the one property that was missing in ur examples is the "Skin" property of RadAjaxLoadingPanel. Tobe ableto display theloading image, u want to set the Skin property to any of the valid Telerik skins (like Vista, Black, Hay, Outlook, and more.). P

VIEWS ON THIS POST

53

Posted on:
Friday, September 21, 2012
View Replies !

Jquery Ajax call to ASPX page not displaying datatble in radgrid - Ajax Forum - ASP.NET Controls

I figured this out myself.

VIEWS ON THIS POST

18

Posted on:
Friday, September 21, 2012
View Replies !

RadAjaxManager loading/displaying controls in reverse order - Ajax Forum - ASP.NET Controls

I am upgrading 2008 Q3 version of telerik control to 2011 Q3 version in my project in .NET 4.0. I've a RadAjaxManager used in the page that has a edited control as asp:panel. More than one user controls are dynamically loaded in to the asp:panel. Initally all the instance of the
VIEWS ON THIS POST

20

Posted on:
Friday, September 21, 2012
View Replies !

RadAjaxLoadingPanel not displaying - Ajax Forum - ASP.NET Controls

I have a RadGrid and an RadAjaxLoadingPanel and wire them together. I select to update a row of the grid within an Update Form template and if I click on the update or cancel buttons of my update form the RadAjaxLoadingPanel shows as normal. If I click into one of
VIEWS ON THIS POST

16

Posted on:
Saturday, September 22, 2012
View Replies !

How can i show .rtf file(stream) content in RadEditor using LoadRtfContent() ? - Ajax Forum - ASP.NET Controls


I attempting to show.rtf file content in RadEditor using LoadRtfContent(stream) method.In rtf file contains tables & images,In radeditor, I'm not able to show tables & images.Pls provide me any answer for my question.Pls find the given code

VIEWS ON THIS POST

28

Posted on:
Saturday, September 22, 2012
View Replies !

RadAjaxLoadingPanel with image/Text does not show in the center screen - Ajax Forum - ASP.NET Controls

Phuc
To achieve the deed functionality youcan try toadd a RadAjaxManager control to the master page and
set its DefaultLoadingPanelID to the ID of the RadAjaxLoadingPanel situated on
the master page. Then u want to handle the manager OnRequestStart
client-side vent and c

VIEWS ON THIS POST

12

Posted on:
Saturday, September 22, 2012
View Replies !

displayed once loadingpanel - Ajax Forum - ASP.NET Controls

The loading panel displays the first time.
HttpAnalyzer first time:<table id="ctl39_RadioButtonList_Aim" class="radiobuttonlist-default" border="0" style="width:100 ;">
<tr>
<td><input id="ctl39_RadioButtonList_Aim_0" type="radio" name="ctl39$Radi

VIEWS ON THIS POST

20

Posted on:
Monday, September 24, 2012
View Replies !

RadAjaxLoadingPanel Loading image not presented for user controls - Ajax Forum - ASP.NET Controls

Hello
I've execute into a strange problem with the RadAjaxLoadingPanel whereby the panel appears correctly, but not the default loading icon.
I have fundamentally generated a version of the Wizard example in the Telerik demos:
http: demos.telerik.com aspnet-ajax

VIEWS ON THIS POST

33

Posted on:
Tuesday, September 25, 2012
View Replies !

RightContextMenu on presented on right click on RadMenu item in IE8 - Ajax Forum - ASP.NET Controls


We're using telerik controls in our software the difficulty that We're facing is that the right context menu isn't presented on right click on the RadMenu item in IE8 . I'm not able to find out why this is happening . Pls assist

VIEWS ON THIS POST

32

Posted on:
Tuesday, September 25, 2012
View Replies !

RadAjaxLoadingPanel not displaying on RadGrid Filter - Ajax Forum - ASP.NET Controls

Eric
I followed ur scenario and prepared a sample project that is working as expected. Pls provide it a try and let me know if it works for u or u want further assistance.

VIEWS ON THIS POST

36

Posted on:
Tuesday, September 25, 2012
View Replies !

Content in MasterPage not displaying - Ajax Forum - ASP.NET Controls

Tony
I reviewed ur code snippet and it looks correct to me. I alsotried to replicate the difficulty on my side but to no avail. Find attached a sample runnable software that demonstrates the correct functionality of the problematic part of ur code. Test

VIEWS ON THIS POST

27

Posted on:
Wednesday, September 26, 2012
View Replies !

loading panel presented after canceling partial postback. - Ajax Forum - ASP.NET Controls

A loading panel is presented after canceling a partial postback in javascript on the PageRequestManagers InitalizeRequest event handler. How can I receive rid of the loading panel Is there any other way to cancel the partial postback
Ihave radio buttons in the command section

VIEWS ON THIS POST

23

Posted on:
Wednesday, September 26, 2012
View Replies !

ajax Popup Extender isn't presented in postback - Ajax Forum - ASP.NET Controls


I am using PopupExtender. In Rad grid in each row I've an image button.. While clicking that am opening the pop extender. Its working fine. But am filling grid in a button click event that will throw a javascript confirm alert. if i press yes then in postback i will rebind the grid

VIEWS ON THIS POST

28

Posted on:
Wednesday, September 26, 2012
View Replies !

No RadAjaxLoadingPanel animation when content is ?show: none? - Ajax Forum - ASP.NET Controls

Kristijan
The behavior u experienced is rather expected. The RadAjaxLoadingPanel can't calculate its dimentions as there are no visible controls on the basis of that to do it, it isn't presented. The easiest way to overcome this, is to position the RadAja

VIEWS ON THIS POST

28

Posted on:
Thursday, September 27, 2012
View Replies !

RadAjaxLoadingPanel not presented

Hello
I'm attempting to use the control RadAjaxLoadingPanelbased on the demo http: demos.telerik.com aspnet-ajax ajax examples loadingpanel loadingimages defaultcs.aspx .
For unkown reason, it isn't working, the RadAjaxLoadingPanelcontrol isn't presented.
Note

VIEWS ON THIS POST

9

Posted on:
Saturday, September 29, 2012
View Replies !

IE9 Ajax show

I have downloaded IE9 and Currently installed the latest version of Telerik ASP.NET Ajax controls. I have found that when the ajax spinner is spinning the screen behind It's now turning white when it should be grayed out just like before. However when in compatability see the aj
VIEWS ON THIS POST

13

Posted on:
Saturday, September 29, 2012
View Replies !

Formview edited values not presented on the first button click

Hello
I havefollowing labels (updtlbl1,updtlbl2,updtlbl3) inside a form see, Theyare edited by a button(btnSave) outside the formview.
I am updating the db with entity modeland I am using RadAjaxmanagerI have the code snippet as given below.Data is saved suc

VIEWS ON THIS POST

15

Posted on:
Saturday, September 29, 2012
View Replies !

Generic way of displaying error in master page while using RadAjaxManagerProxy


I have a master page whenere my RadAjaxManager is added and in the content pages I have RadAjaxManagerProxy .
Now I want to show success failure messages on the content page events like (button clicks , grid edit combobox changed and more) in a Label in MasterPag

VIEWS ON THIS POST

14

Posted on:
Sunday, September 30, 2012
View Replies !

loading.gif not presented in RadAjaxLoadingPanel with Internet Explorer

I've a RadAjaxLoadingPanel that has a gif image loaded by GetWebResourceUrl function. When I make an ajax postback the loading panel is presented (a gray panel covering all the controls in the page) but the gif inside the loading panel isn't presented. This only h
VIEWS ON THIS POST

21

Posted on:
Sunday, September 30, 2012
View Replies !