RadStyleSheetManager with embedded resource style sheets

8 posts, 0 answers
  1. Ryan
    Ryan avatar
    5 posts
    Member since:
    Feb 2009

    Posted 08 Apr 2010 Link to this post

    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> 
     
  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2772 posts

    Posted 09 Apr 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ryan
    Ryan avatar
    5 posts
    Member since:
    Feb 2009

    Posted 09 Apr 2010 Link to this post

    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?

  5. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 14 Apr 2010 Link to this post

    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.
  6. msigman
    msigman avatar
    141 posts
    Member since:
    Apr 2008

    Posted 18 Feb 2011 Link to this post

    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.
  7. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 21 Feb 2011 Link to this post

    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
  8. David Simmonds
    David Simmonds avatar
    56 posts
    Member since:
    Mar 2010

    Posted 20 Jun 2011 Link to this post

    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>
  9. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 23 Jun 2011 Link to this post

    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.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017