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

Avoiding unecessary RadProgressManager calls

7 Answers 66 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
CSurieux
Top achievements
Rank 2
CSurieux asked on 21 Sep 2009, 10:31 AM
Hello,

Using RadProgressManager to monitor a custom process, I would appreciate being able to start it only when necessary.
My page works like an expert and the progress monitoring should be done only when pressing a button in last step (tab), this button doing a full postback, not an ajaxcall back.
It works but I discovered that during all the previous ajax callback, the progress area is sending unecessary requests to its handler.
How to supress them, using radprogress manager for last step only.
I thought setting its 'enabled' status during a previous call, pb is that all previous steps are ajaxified, only last one is a postback.


Thanks for help.
CS

7 Answers, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 23 Sep 2009, 09:59 AM
Hello Christian Surieux,

Indeed this is an issue with the RadProgressArea. Fortunately, there is a workaround. Please, paste the following code right after your script manager declaration:

var prm = Sys.WebForms.PageRequestManager.getInstance(); 
prm.add_beginRequest(beginRequestHandler); 
var isInAsyncRequest; 
var originalClientSubmit; 
 
if (!originalClientSubmit) {  
originalClientSubmit =  
Telerik.Web.UI.RadProgressManager.prototype._clientSubmitHandler; 
}  
 
function pageLoad() { 
isInAsyncRequest = false
Telerik.Web.UI.RadProgressManager.prototype._clientSubmitHandler = function(e) { 
if (!isInAsyncRequest) { 
originalClientSubmit.apply(this, [e]); 
function beginRequestHandler(sender, args) { 
isInAsyncRequest = true

It should do the job.

Best wishes,
Genady Sergeev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
CSurieux
Top achievements
Rank 2
answered on 30 Sep 2009, 08:04 AM
Hello Sergeev,

Thanks, this make it work far better.
But I have still a little problem an I can't see why: when for some reason my 'long process' return earlier than normally due to some error, i get an error in IE8 with this message:

Détails de l’erreur de la page Web

Agent utilisateur : Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; InfoPath.2; OfficeLiveConnector.1.4; OfficeLivePatch.1.3; .NET CLR 3.0.30729)
Horodateur : Wed, 30 Sep 2009 07:54:02 UTC

Message : 'Telerik.Web.UI.RadProgressManager.prototype' a la valeur Null ou n'est pas un objet.
Ligne : 526
Caractère : 9
Code : 0
URI : http://adnsrv20:5052/site/650/Migrate_Crm_Data.aspx?RadUrid=90bee803-7778-43b7-9846-88f0ab6ad54b

 


There is certainly a synchronisation error in the order calls are made clientside ?

Any idea ?

Many thanks.

CS
0
Genady Sergeev
Telerik team
answered on 30 Sep 2009, 11:26 AM
Hi Christian Surieux,

This error may happen when the client components haven't entirely loaded up. There are two solutions to the problem. One is to enwrap the aforementioned code in an If block that checks whether Telerik.Web.UI is null. Another option is to put the entire code in the client pageLoad function or in $(document).ready if you are using jQuery.

Regards,
Genady Sergeev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
CSurieux
Top achievements
Rank 2
answered on 30 Sep 2009, 01:42 PM
Thanks Sergeev,

What could be an easy start documentation on JQuery ?

One more question, I remarqued that in Telerik Poject templates you insert RadScriptmanger like this

<

 

form id="form1" runat="server">

 

 

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">

 

 

<Scripts>

 

 

<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />

 

 

<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />

 

 

</Scripts>

 

 

</telerik:RadScriptManager>

 


Is there a difference and an advantage over the traditional ajax.net scriptManager ?

Regards

CS
0
Genady Sergeev
Telerik team
answered on 02 Oct 2009, 07:36 AM
Hi Christian Surieux,

Yes, RadScriptManager has increased performance compared to AspScriptManager. When loading a page with several controls on it, the number of these files can become very large, often resulting in a reduced page load time and increased traffic. The reason for this problem is that browsers make a separate request to the server for each of these resources. This is the way ScriptManager works, separate request for each resource. In contrast, RadScriptmanager combines the used resources to a single request. All you need is to add a RadScriptManager to your page and the javascript files get combined into a single file.

Greetings,
Genady Sergeev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
CSurieux
Top achievements
Rank 2
answered on 02 Oct 2009, 07:51 AM
Thanks,
And why adding the lines to include Telerik.Web.UI.Common library, in the past I was not specifiyng them and they seem to comme automatically.
Is there also a performance impact for this ?

You don't answer concerning jquery, have any valuable source of information to recommand ?

Thanks again for your time
CS
0
Genady Sergeev
Telerik team
answered on 02 Oct 2009, 09:01 AM
Hi Christian Surieux,

The two script references are in concern with jQuery. They serve for bringing jQuery to your page in case you don't use any RadControls in it. In case you have RadControls, you can remove the script reference and access jQuery with the following:

// assigns jQuery to the $ alias 
var $ = $telerik.$; 
 

Kind regards,
Genady Sergeev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Upload (Obsolete)
Asked by
CSurieux
Top achievements
Rank 2
Answers by
Genady Sergeev
Telerik team
CSurieux
Top achievements
Rank 2
Share this question
or