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

RadStyleSheetManager with embedded resource style sheets

7 Answers 521 Views
ScriptManager and StyleSheetManager
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 08 Apr 2010, 04:41 PM

The application that I am working with has hundreds of style sheets for different clients that are dynamically loaded based on client configuration. All style sheet references are defined in the application's master page. After adding a few newer Telerik controls to some of the pages along with the additional custom skin css references, we have reached the 31+ max css limit for IE and various controls are beggining to experience style/rendering issues. The RadStyleSheetManager seems like a good solution to implement in order to consolidate these multiple css references into one.

From the little documentation available for the RadStyleSheetManager, it seems that it only works for style sheets that are in a separate class library defined as a web resource... is this the only way? Can the RadStyleSheetManager combine css embedded resources that are local to the project? Something like ...

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RadStyleSheetManager._Default" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server">  
    <title></title>  
</head> 
<body> 
    <form id="form1" runat="server">  
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" Runat="server">  
        <StyleSheets> 
            <telerik:StyleSheetReference Path="Stylesheet1.css" Name="StyleSheet1.css" /> 
            <telerik:StyleSheetReference Path="Stylesheet2.css" Name="StyleSheet2.css" /> 
            <telerik:StyleSheetReference Path="Stylesheet3.css" Name="StyleSheet3.css" /> 
        </StyleSheets> 
    </telerik:RadStyleSheetManager>   
    <div> 
        <div class="Style1">Style 1</div> 
        <div class="Style2">Style 2</div> 
        <div class="Style3">Style 3</div> 
    </div> 
    </form> 
</body> 
</html> 
 

7 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 09 Apr 2010, 07:51 AM
Hi Ryan,

Currently, RadStyleSheetManager does not support combining resources that are not embedded in an assembly. We might reconsider this, but for the moment you have to embed your resources. Please, use this tutorial:

http://www.telerik.com/help/aspnet-ajax/radstylesheetmanager.html

Also, keep in mind that IE is limited to 4096 CSS selectors per file.

I hope this helps.

All the best,
Tsvetomir Tsonev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ryan
Top achievements
Rank 1
answered on 09 Apr 2010, 11:00 PM
Thanks for the response.

What about the css references that are generated by Telerik? Can those be combined into a single resource request? For instance, we use several custom skins that utilize the base style sheets provided by the Telerik assembly. If we have 20 different rad controls on the page, then Telerik will generate 20 resource references pointed to those base styles sheets. Can the RadStyleSheetManager be used to combine these?

0
Veselin Vasilev
Telerik team
answered on 14 Apr 2010, 08:54 AM
Hi Ryan,

If you have not disabled the embedded base stylesheets - then yes, the RadStyleSheetManager should combine them.

Kind regards,
Veskoni
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
msigman
Top achievements
Rank 2
answered on 18 Feb 2011, 07:21 PM
I just wanted to provide my opinion that it would be very useful to be able to add my own external stylesheets to RadStyleSheetManager, for example using the <StyleSheets></StyleSheets> property.
0
Yana
Telerik team
answered on 21 Feb 2011, 10:26 AM
Hello Matthew,

Thank you for sending your suggestion, but currently you should embed the custom styles in an assembly as described in the provided article.

Greetings,
Yana
the Telerik team
0
David Simmonds
Top achievements
Rank 1
answered on 20 Jun 2011, 06:01 PM
I have a master page (site1.master) with a RadStyleSheetManager statement right after the form statement.

I then have a master page (NestedMasterPage1.master) that uses site1.master. Then I have an aspx page that uses NestedMasterPage1.master. That page has a tab control that contains a few tabs. Each tab contains an ascx file. Each ascx file contains a radgrid that has an EditFormSettings property that uses WebUserControl as the EditFormType. When I click on the "Add ..." button on the grid (CommandItemSettings AddNewRecordText), I get the message box indicating that the maximum number of style sheets has been reached. I thought the RadStyleSheetManager was supposed to eliminate this error by combining the stylesheets for Telerik controls. Please advise.
<form id="form1" runat="server">
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
        <StyleSheets>
        </StyleSheets>
    </telerik:RadStyleSheetManager>
0
Helen
Telerik team
answered on 23 Jun 2011, 11:29 AM
Hello David,

Do you use external stylesheet files? If yes - probably you will find helpful the following forum post:
http://www.telerik.com/community/forums/aspnet-ajax/scriptmanager-and-stylesheetmanager/question-on-2010-sp1.aspx

RadStyleSheetManager combines all the requests to the "stylesheet resource files" into a single one, so if you use the embedded stylesheets of telerik controls, RadStyleSheetManager will combine them.

Best wishes,
Helen
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.

Tags
ScriptManager and StyleSheetManager
Asked by
Ryan
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Ryan
Top achievements
Rank 1
Veselin Vasilev
Telerik team
msigman
Top achievements
Rank 2
Yana
Telerik team
David Simmonds
Top achievements
Rank 1
Helen
Telerik team
Share this question
or