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

Question on 2010 SP1

10 Answers 420 Views
ScriptManager and StyleSheetManager
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 15 Dec 2010, 05:40 PM
What does this mean?

Improved: RadStyleSheetManager to combine style sheets in a designated external folder

We can combine css not in assemblies now?

10 Answers, 1 is accepted

Sort by
0
Accepted
Simon
Telerik team
answered on 21 Dec 2010, 02:15 PM
Hello Steve,

Yes, with Q3 2010 SP1 RadStyleSheetManager is able to serve and/or combine external style sheet files. There are a few requirements, though, which you should have in mind when using the feature.

First, the folder which contains the style sheet files must be explicitly stated in the web.config of the application:
<appSettings>
  <add key="Telerik.Web.UI.StyleSheetFolder" value="~/StyleSheets"/>
</appSettings>

Additionally the folder must be inside the application's folder tree. Then you can register the individual style sheet files in RadStyleSheetManager:
<telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
    <StyleSheets>
        <telerik:StyleSheetReference Path="~/StyleSheets/StyleSheet1.css" />
        <telerik:StyleSheetReference Path="~/StyleSheets/Base/StyleSheet2.css" />
    </StyleSheets>
</telerik:RadStyleSheetManager>

Finally the external style sheet files must be inside the targeted folder as otherwise a server-side exception will be thrown.

I hope this information helps.

Regards,
Simon
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 21 Dec 2010, 02:52 PM
It helps, and it's awesome!

:D 

Thanks so much guys, this has been on my wishlist forever.

Now since you're running it through a pipe to combine, is it also minifying?...if not...can it? :)
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 21 Dec 2010, 05:17 PM
Is there a way to specify multiple folders in the web.config entry?
0
Simon
Telerik team
answered on 22 Dec 2010, 02:52 PM
Hi Steve,

External style sheets are run through the same pipeline as embedded ones, i.e. they are combined and compressed (if either or both are turned on).

Currently there is no way to specify multiple folders, however, we will implement this in the upcoming weeks.

I hope this helps.

All the best,
Simon
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
RRT
Top achievements
Rank 1
answered on 31 Dec 2010, 05:47 PM
Can you explain to me why we even need to specify the directories? This was a nice first step, but what I need is something like RadScriptManager. Why can't I just do:

<CompositeStyleSheet>
<StyleSheets>
...
</StyleSheets>
</CompositeStyleSheet>

I have css files in multiple locations, having to specify directories will be a pain. I think the ideal would be to make this work just like RadScriptManager. Is there a reason why it's done so differently?
0
Simon
Telerik team
answered on 04 Jan 2011, 04:27 PM
Hello Steve,

Yes, we have implemented the 'target folder' approach because of the fact that a malicious user can craft a URL that can fetch any file from the project file structure. Pointing out the allowed folders resolves this potential security hole as in this way we can deny access to any requested file outside the designated folder.

ScriptManager (and RadScriptManager in particular) work in the same way internally however the ASP.NET Framework handles the security checks.

I hope this sheds more light on the matter.

Greetings,
Simon
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 01 Mar 2011, 10:15 PM
What's the syntax to get the mutliple folders?  I see the notes in the last release that it can support more than one folder now...

This doesn't seem to work

The style sheet '~/styles/common/commonnew.css' is not located in any of the 'Style Sheet' folders designated in the web.config.



<telerik:RadStyleSheetManager ID="stylesheetManager" runat="server" CdnSettings-TelerikCdn="Disabled" >
    <StyleSheets>
        <telerik:StyleSheetReference Path="~/styles/common/commonnew.css" />
        <telerik:StyleSheetReference Path="~/Skins/MedportalGrey/PanelBar.MedportalGrey.css" />
    </StyleSheets>
</telerik:RadStyleSheetManager>


<add key="Telerik.Web.UI.StyleSheetFolder" value="~/Skins/Medportal,~/styles/common,~/styles" />
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 01 Mar 2011, 10:30 PM
**REMOVED**
0
Matt Dufrasne
Top achievements
Rank 1
answered on 06 Jul 2011, 01:42 AM
What should this work with 2010.2.929.20 ?

I still get the error -- (Object instance exception)

EDIT: Yeah -- I tried the latest available trial and that worked instantly.
Is there a hot fix for just this issue since my upgrade rights have expired?
0
Dimitar Terziev
Telerik team
answered on 11 Jul 2011, 12:08 PM
Hello Matt,

We are unable to provide you with a hot fix, you should upgrade if possible.

Regards,
Dimitar Terziev
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
ScriptManager and StyleSheetManager
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Simon
Telerik team
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
RRT
Top achievements
Rank 1
Matt Dufrasne
Top achievements
Rank 1
Dimitar Terziev
Telerik team
Share this question
or