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

Telerik injecting javascript after each ajax update

3 Answers 35 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 02 Oct 2008, 11:51 AM
Hi,

I have an Ajax page which has a number of Telerik controls on it.

It would appear that each Ajax response is including some inline script:

if (typeof($telerik) != 'undefined' && !$telerik.isSafari)  
{  
    var links = document.body.getElementsByTagName('link');  
    if (links && links.length>0)  
    {  
        var documentHead = document.getElementsByTagName('head')[0];  
        if (documentHead)  
        {  
            for (var i=links.length-1;i>=0;i--)  
            {  
                var linkTag = links[i];  
                if (linkTag.title == 'Telerik stylesheet')  
                {  
                    if ($telerik.isIE)  
                    {  
                        linkTag = linkTag.cloneNode(true);  
                    }  
                    documentHead.appendChild(linkTag);  
                }  
            }  
        }  
    }  

Is it possible to turn this off? Is it possible to have a function call instead? My concern is that performance is degrading and the DOM is forever getting larger.

Thanks,
Martin


3 Answers, 1 is accepted

Sort by
0
Lini
Telerik team
answered on 03 Oct 2008, 06:27 AM
Hello Martin,

Please update your project with a more recent version of the RadControls for ASP.NET AJAX. I think this problem was fixed in the Q2 2008 release. If you do not wish to upgrade at this time, then you can workaround this problem by manually setting the EnableAjaxSkinRendering property of all RadControls on the page to false.

Kind regards,
Lini
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Martin
Top achievements
Rank 1
answered on 03 Oct 2008, 08:03 AM
Hi Lini,

I have upgraded and now using version 2008.2.826.35 of Telerik.UI.dll. The javascript is still injected, allbeit written out slightly differently.

It is not proving to be a performance problem right now, so am ignoring it.

Just as a note, upgrading has meant that my version of the Office Ribbon Bar taken from your site, now renders quite differently!

Thanks,
Martin
0
Lini
Telerik team
answered on 03 Oct 2008, 11:08 AM
Hello Martin,

This script is sent during an Ajax request if the following two conditions are met:

- you are updating at least one of the RadControls.
- the control has its EnableAjaxSkinRendering property set to true. This can happen if the control was dynamically added during the Ajax request, its ViewState is disabled, or it was initially hidden and was made visible.

If all RadControls on the page have EnableAjaxSkinRendering set to false, the script will not be used. Its purpose is to load the control skins in the page header, which ensures that the controls will display correctly.

Best wishes,
Lini
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Martin
Top achievements
Rank 1
Answers by
Lini
Telerik team
Martin
Top achievements
Rank 1
Share this question
or