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

Can RadScriptManager combining of scripts include custom external javascript files?

5 Answers 207 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 08 Aug 2008, 01:39 AM
Hi

I am using Visual Studio 2008, .NET 3.5 with Telerik 2008 Q2 controls.

I was reading in the below article that it is possible to add custom style sheets for the RadStyleSheetManager:

ms-help://MS.VSCC.v90/MS.VSIPCC.v90/telerik.aspnetajax.radcontrols.2008.Q2/telerik.aspnetajax.radcontrols.common.2008.Q2/radstylesheetmanager.html


My question is a similar approach with external Javascript files possible for RadScriptManager? This is already dropping the requests for Telerik controls making for a faster user experience, but it would be good to include custom external Javascript files as well.


Kind regards

Mark Eaton

5 Answers, 1 is accepted

Sort by
0
Erjan Gavalji
Telerik team
answered on 08 Aug 2008, 07:53 AM
Hi Mark,

RadScriptManager has the same capability as far as the script files are included as EmbeddedResources to an assembly, used by the application. All you need is add the respective ScriptReference with its Path, Assembly and (Resource)Name to the Scripts collection of RadScriptManager. In fact, if a page uses a third-party control which is an IScriptControl (e.g. some of the Ajax Control Toolkit controls), RadScriptManager will merge its scripts automatically.

To my regret there is a small known limitation in VS 2005 - the Visual Studio designer cannot retrieve the base class properly and does not have intellisense for the <Scripts> property in HTML mode. The good news is that this glitch is fixed in VS 2008.

I hope this helps.

Kind regards,
Erjan Gavalji
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mark
Top achievements
Rank 1
answered on 10 Aug 2008, 11:03 PM
Thanks for the response, I'm keen to test this out.

Would this respect cache headers for Javascript files if setup by IIS?


Kind regards

Mark Eaton
0
Erjan Gavalji
Telerik team
answered on 11 Aug 2008, 04:54 AM
Hi Mark,

No, RadScriptManager does not detect cache headers set to files by the IIS snapin. Actually I might have not understood you correctly - how would you define a cache header for a JavaScript file, which is embedded as a webresource to an assembly?

The control sets a cache header to its output, which is configured to vary by the query string parameters and is for valid about a year.

Kind regards,
Erjan Gavalji
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mark
Top achievements
Rank 1
answered on 11 Aug 2008, 06:22 AM
Actually this may be my lack of understanding of how it all works as I am inexperienced in using resource assemblies.

In the link in my 1st post it had this to say about the RadStyleSheetManager:

"As the RadStyleSheetManager control uses ASP.NET 2.0 WebResource capabilities it benefits from gzip content compression (for browsers, supporting that) and script caching."

Am I correct in understanding that if IIS is setup to cache css/images for 3 days then the RadStyleSheetManager won't retry to get this until that time has expired?

And if I was to configure IIS to cache Javascript files for 3 days would RadScriptManager not get this until that time has expired as well?

Hope this makes sense.


Kind regards

Mark Eaton


0
Accepted
Erjan Gavalji
Telerik team
answered on 11 Aug 2008, 06:37 AM
Hi Mark,

Yes, that's true, setting a cache expiration for images/css/javascript files in IIS won't affect the cache setting of the RadScriptManager/RadStyleSheetManager output (as far as these images/css/javascript files are embedded in an assembly). Let me add some more details:

RadScriptManager and RadStyleSheetManager read the resources they'd output and serve them. To change a resource in an assembly you need to rebuild it. Once the assembly is rebuilt and its version is changed, the cache setting will expire and users, accessing a page will get the fresh resource.

Regards,
Erjan Gavalji
the Telerik team

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