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

Sharing WebResources between Radwindows and Parent Page

3 Answers 53 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 2
Jon asked on 15 Apr 2009, 12:02 AM
I created a Custom Portal Application that uses Windows Workflow on the back-end and Telerik Contols for the View. I use the RadWindow control for each Portlet (Module) and everything works beautifully, really excellent tools.

Is there a way to share JavaScript (WebResouce.axd requests) between RadWindows(Iframes) and the Parent Page.
Most of my RadWindows have some combination of a RadGrid, RadToolbar, RadTabStrip, and maybe some RadMaskTextBoxes and ComboBoxes.

The reason I ask is because requests for the same scripts are being made for each Radwindow. Each RadWindow has its own copy of the Javascript.

I have placed ScriptManagers on the MasterPage and on PortletWindow.aspx (which is my Portlet controller and the target of the RadWindow Controls).

I realize that this is probably not possible, and things work great on a High speed connection but I thought I would ask since everytime a Portlet is added 200kb or so gets downloaded.

This means that if the user has 6 Windows open in their Workspace Firebug is telling me that 1.2mb was downloaded.

Thanks,
Marc



3 Answers, 1 is accepted

Sort by
0
Tervel
Telerik team
answered on 16 Apr 2009, 08:42 AM
Hello Marc,

We are glad to know that you find the products useful.
The embedded scripts of the controls have unique IDs which allows them to be cached on the client side. So, if your browser cache is enabled (which is the default option)  the scripts files loaded in the parent page should be used from the cache when the child page in RadWindow loads.

That said, in case you wish to combine the scripts of several controls into a single file and add this file manually to your page, you can do so as the scripts are distributed with the RadControls installation. The following Help article provides more information:
http://www.telerik.com/help/aspnet-ajax/disabling_embedded_resources.html

Greetings,
Tervel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jon
Top achievements
Rank 2
answered on 16 Apr 2009, 04:58 PM
Tervel,
Thanks for the response and verifying that cached scripts would be shared between parent and child windows. I also found http://www.telerik.com/help/aspnet-ajax/disabling_embedded_resources.html very useful offers a lot of transparency into whats being pulled.

But if the WebResourse.axd Query string is different on my parent page or from RadWindow to Radwindow because they don't all use all the same controls will those scripts still be requested and not pulled from cache?

Only when the WebResourse.axd Query string is exactly the same will the browser look in cache?

For example my parent page has a Toolbar, Tabstrip, RadMenu, RadPanel, RadSplitter, RadWindowManager.
And one of my Portlets(Radwindow) has a Toolbar, Radgrid, Calendar, Combobox, RadWindowManager.

Do I want remove the RadScriptManager so that the Toolbar and Radwindow Scripts will only be requested once?
Or do should I create a custom WebResource that bundles all of the scripts and so that the request looks the same accross the board?

Thanks again,
Marc
0
Tervel
Telerik team
answered on 17 Apr 2009, 07:57 AM
Hi Marc,

"Only when the WebResourse.axd Query string is exactly the same will the browser look in cache?"
That is correct. The browser caching mechanism relies on the resource URL. When I wrote to you my original answer I was under the impression that you use the same set of controls on both pages.

There are two things you might want to try
1) You can disable the script combining capabilities of RadScriptManager - which will make the intial page load a bit slower, but then all scripts will be cached and when you load your RadWindow page they will be taken from the browser cache.

2) Alternatively, as I originally suggested - you can combine the scripts of the controls which are used on both pages into a single file and add this file manually to your page, as the scripts are distributed with the RadControls installation.
You will need to turn the embedded scripts for these controls off by setting EnableEmbeddedScripts = false.

Best wishes,
Tervel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Jon
Top achievements
Rank 2
Answers by
Tervel
Telerik team
Jon
Top achievements
Rank 2
Share this question
or