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

How to use RadStyleSheetManager

9 Answers 335 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shane
Top achievements
Rank 1
Shane asked on 16 Mar 2008, 11:56 PM
Hi Guys,

How can use RadStyleSheetManager with my own stylesheets. I mean, I want to use the RadStyleSheetManager feature to gzip and combine my own stylesheet.

Thanks!

Shane

9 Answers, 1 is accepted

Sort by
0
Erjan Gavalji
Telerik team
answered on 17 Mar 2008, 08:19 AM
Hi Shane,

RadStyleSheetManager does not support external stylesheets. This functionality is already in our future plans but we still didn't put it in our schedule. What you can do is create a custom module that could compress the stylesheets. Rick Strahl has a very good post on the matter which you can use.

I hope this helps.

Kind regards,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Peter Zolja
Top achievements
Rank 1
answered on 24 Mar 2008, 02:06 PM
Hi,

The ability to combine CSS files is something that would be extremely cool to have; the sooner the better. We have compression at the IIS level which is probably better than doing it via .NET anyway. What I'm interested in is the ability of RadStyleSheetManager to merge all the css files into one to limit the number of requests the browser has to make. I don't want it to compress the css, IIS will handle that. If it does that by default is there a way to disable that? (Same for RadScriptManager).

What would be nice if there was a way to tell the RadStyleSheetManager to include a specific css file in the mix. Not sure if it doing it automatically is a good idea.
0
Erjan Gavalji
Telerik team
answered on 25 Mar 2008, 11:13 AM
Hi Peter,

I understand the need of extended control over the RadScriptManager and RadStyleSheetManager controls. Although not certain yet, we will do our best to cover both the scenarios of specifying external stylesheets/scripts to the merged output and turning compression off for RadControls "Prometheus" Q2 2008.

Thanks for your comments!

Cheers,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Social_Quotient
Top achievements
Rank 1
answered on 28 Mar 2008, 10:01 PM
I would like to throw my vote in for this function for external css files and scripts. If done right this really could reduce http requests significantly for those of us that use a lot of telerik on a page.

Thanks
John
0
Shane
Top achievements
Rank 1
answered on 29 Mar 2008, 12:12 AM
Hi All,

You still can combine your own scripts using RadScriptManager.

use <script><asp:scriptreference> tags.

Shane
0
Erik Lidman
Top achievements
Rank 1
answered on 11 Nov 2008, 09:04 PM
I have tried to combine my own javascript using RadScriptManager and the latest version of RadControls (2008.03.1105.35) but with no luck. I still get a HTTP-request for each file when analysing the page using YSlow. This is the code I used:

<telerik:RadScriptManager EnableScriptCombine="true" EnablePartialRendering="true" ID="RadScriptManager1" runat="server"
<Scripts> 
     <asp:ScriptReference Path="/Common/JS/LoadingPanel.js" /> 
     <asp:ScriptReference Path="/Common/JS/Dialog.js" /> 
     <asp:ScriptReference Path="/Common/JS/Common.js" /> 
     <asp:ScriptReference Path="/Common/JS/ObjectTree.js" /> 
</Scripts> 
</telerik:RadScriptManager> 

Any ideas?

/Daniel
Viewtarget AB



0
Wei
Top achievements
Rank 1
answered on 11 Nov 2008, 09:16 PM
Well... you could always write a batch file to pre-combine them.

e.g.

@echo off
copy /B /Y 1.js+2.js+3.js+4.js out.js
0
Erik Lidman
Top achievements
Rank 1
answered on 11 Nov 2008, 10:39 PM
I have actually implemented my own HTTPHandler to combine the javascripts now (based on this excellent post ). But it would still be interesting to know if the RadScriptManager is supposed to support this. And it would save one more HTTP-request if you are using RadControls on a page :)

0
Shane
Top achievements
Rank 1
answered on 11 Nov 2008, 11:04 PM
To combine the script, the scripts has to be an embedded resource.

Right click on the JS file and go to the property and change the "Build Action" to Embedded Resource and then in the AssemblyInfo file you will have to add the resource. For an example 

<Assembly: WebResource(

"ContentJS.JavaScript.js", "text/javascript")>

And then 

 

<

 

asp:ScriptReference Assembly="ContentJS" Name="ContentJS.JavaScript.js" />

I hope this helps.

Cheers,
Bardia

 

Tags
General Discussions
Asked by
Shane
Top achievements
Rank 1
Answers by
Erjan Gavalji
Telerik team
Peter Zolja
Top achievements
Rank 1
Social_Quotient
Top achievements
Rank 1
Shane
Top achievements
Rank 1
Erik Lidman
Top achievements
Rank 1
Wei
Top achievements
Rank 1
Shane
Top achievements
Rank 1
Share this question
or