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

Tabstrip/Multipage load content twice when using set_contentUrl

1 Answer 66 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Chris Owens
Top achievements
Rank 1
Chris Owens asked on 10 Jul 2012, 06:26 AM
The code that is called by set_contentUrl causes the content to always be loaded twice.

When creating a new tab and pageview clientside, when you call set_contentUrl on the newly created PageView the _createIframe code is eventually called resulting in the content being loaded twice due to the src of the iframe being specified two different ways with no conditional after the first succeeds.  Stepping through after the call to set_contentUrl in IE9 confirms this and is a huge performance issue as it doubles every page viewed in a tab.

Here's the Telerik js code (that is included as the webresource):

b.RadPageViewCollection._createIframe=function(c){var d=document.createElement("iframe");
d.frameBorder="0";
d.style.width="100%";
d.style.height="100%";
if(c._contentUrl){d.src=c._contentUrl;
}c.get_element().appendChild(d);
a(c.get_element()).find("iframe").attr("src",c._contentUrl);
};

The code doesn't match the scripts included in the install directory and if you switch to EnableEmbeddedScripts=false and specify the individual scripts required ( a real pain in the @$$ since you can't mix and match), the content is not loaded twice.  Looks like the scripts in the webresource are outdated.

By mix & match, I meant that you can't just have one Telerik control with EnableEmbeddedScripts=false, as there is no error handling if things like $Telerik are already instantiated - so you have to do it for every Telerik control on the page.

1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 12 Jul 2012, 09:06 AM
Hello,

Could you clarify the version of the controls that you are using?

Kind regards,
Dimitar Terziev
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
TabStrip
Asked by
Chris Owens
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Share this question
or