+1-888-365-2779
Try Now
More in this section

Forums / Designing with Sitefinity / RadStyleSheetManager not combining

RadStyleSheetManager not combining

17 posts, 0 answered
  1. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    18 Aug 2008
    Link to this post
    I'm trying to optimize my page by combining all of the stylesheets for rad controls using the RadSytleSheetManager control I just discovered. However, it does not seem to be combining all of the necessary resources.

    I do get one instance of the Telerik.Web.UI.WebResource.axd, but then I still see like another 8 instances on the page. I inspected these elements and they are the css for all of my other rad controls like tabstrip, radrotator, etc...

    I inspected the WebResource.axd above, and it's full of javascript instead of css. Did I do this incorrectly? I tried following the instructions here: http://www.telerik.com/help/aspnet-ajax/radstylesheetmanager.html but it is still rendering each webresource link individually...

    any help would be greatly appreciated. thank you!
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    21 Aug 2008
    Link to this post
    Hi SelArom,

    Could you give us some more information about the case? For example, are you adding the controls through the control toolbox, or they are hardcoded in the templates?

    Best wishes,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    21 Aug 2008
    Link to this post
    thanks for following up with me

    these are dropped into user controls which are then loaded in web.config and dropped into the page. I have on the home page a tabstrip, multiview, radrotator and radmenu. however, these controls are not all on the same user control. I could probably rework them to all be on the same control if this is necessary, is it?
  4. Sean
    Sean avatar
    271 posts
    Registered:
    31 May 2006
    25 Aug 2008
    Link to this post
    Hi SelArom,

    All the RadControls don't need to be in a single usercontrol.  Are you using the ASP.Net Ajax RadControls found in the Telerik.Web.UI assembly, or are you using the original versions, as far as I know I think it only automagically works with the ASP.Net Ajax versions, with the older version you would manually have to set the <StyleSheets> section in the StyleSheetManager to each of the embedded css files of the various assemblies.

    If you are already using the newer versions then I apologise for wasting your time.

    Cheers
    Sean
  5. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    26 Aug 2008
    Link to this post
    i am using the radstylesheetmanager from the telerik.web.ui found in the sitefinity bin folder. I don't think this is the latest version, but I could be wrong. I think there is a new release of these controls that is supposed to work with sitefinity, but I don't know if that will fix the problem.
  6. Sean
    Sean avatar
    271 posts
    Registered:
    31 May 2006
    27 Aug 2008
    Link to this post
    Hi SelArom,

    I don't think you understood my question, I understand you are talking about the RadStyleSheetManager in the Telerik.Web.UI (and no it isn't the latest) assembly, but are you trying to optimise the style sheets for the old RadControls eg the RadMenu in the RadMenu.Net2.dll?  If so I don't believe it automatically works with those dlls I may be wrong, if that is the case though you would need to upgrade your controls to the ones in the Telerik.Web.UI, currently the SiteMenu, SiteTreeview etc are using the old controls.

    Thanks
    Sean
  7. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    27 Aug 2008
    Link to this post
    oh! okay sorry about that, yes I'm using the separate dlls that are with sitefinity so I guess these are the old ones? I'd like to go ahead and update them, I can do that right, as long as they are running inside of sitefinity? I've seen posts on this before but always ignored them, can you point me to some kind of tutorial/walkthrough for updating these controls?

    thanks!
  8. Sean
    Sean avatar
    271 posts
    Registered:
    31 May 2006
    27 Aug 2008
    Link to this post
    Yeah you can update there shouldn't be any problems with that, as long as the site is running Sitefinity then that includes the license to use the Radcontrols on that same site.

    The best place to find out about upgrading is the RadControls for ASP.Net Ajax and if you look under each control there should be separate documentation on each control.  But it is very simple, I have found anyway.  You basically just need to change everything to use the equivalent class in the new assembly, eg <radM:RadMenu becomes <telerik:RadMenu, and then it is a case of upgrading any changes properties and tweaking skins (if you aren't using the built in ones).  But I am sure you will find your way around it all, the RadControls forums are also a good source of info if you get stuck on anything.

    Cheers
    Sean
  9. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    27 Aug 2008
    Link to this post
    Hi,

    Here is how to upgrade the RadControls in Sitefinity - How to upgrade RadControls. Josh, please tell us if you have any problems!

    Sean, thank you very much for your valuable answers! We have updated your Telerik account for that.

    Kind regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  10. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    27 Aug 2008
    Link to this post
    awesome thanks to you both, but where do I get the latest version do I just download a trial or something from telerik.com?
  11. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    27 Aug 2008
    Link to this post
    Hi SelArom,

    Yes, you just download the trial version of the controls. The licensing of the suite would be done internally and automatically when it is used with Sitefinity.


    Sincerely yours,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  12. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    27 Aug 2008
    Link to this post
    alright well everything kind of went nuts, as all my skins are gone. before I would just point to the skins folder but I'm guessing the new controls have a different approach. I didn't see any mention in the linked articles on how to fix this so I would appreciate any help!

    I set enableembeddedskins to false and now I want to skin my controls with my skins from the radcontrols folder, how do I do this? keep in mind that some controls require the skin to be changed based on the theme of the page. for example on the home page I have themeA, which sets the radmenu skin to match. then you go to a different page and get themeB, which also has a separate skin for radmenu...
  13. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    27 Aug 2008
    Link to this post
    aha it's because the css class names changed! for example instead of .group and .item they are now .rmGroup and .rmItem! i updated the classes and now it's working!

    however, I still have to add the stylesheet manually... is there a way to theme this so that the stylesheet and skin are chosen based on the page theme?
  14. Sean
    Sean avatar
    271 posts
    Registered:
    31 May 2006
    29 Aug 2008
    Link to this post
    Sounds like you are getting there, not too painful once you know how. 

    But to answer your question, if yout want to be able to get your skins picked up by the StyleSheetManager you would need to complile them into a dll there is documentation about this in the StylesheetManager help.  But this means they will be included in the page regardless of which theme you are using, unless you find a way of getting it to do so maybe Telerik can offer some help here, and the only way to make sure the skin doesn't get applied to the wrong control would be to make sure your skins have unique names for each theme.
  15. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    29 Aug 2008
    Link to this post
    I ended up using the siftefinity CssFileLink control, which is a pretty handy tool! I basically just add this to the usercontrol which contains my radmenu, then in the code behind change the linked css file based on the theme:

        protected void Page_Load(object sender, EventArgs e)  
        {  
            // must have a theme!  
            if (string.IsNullOrEmpty(Page.Theme)) return;  
     
            // only show home menu on blue theme for now  
            if (Page.Theme.ToLower() != "blue" && Page.Theme.ToLower() != "home")  
            {  
                CssFileLink1.Enabled = true;  
                CssFileLink1.Visible = true;  
                TopNavMenu.Items[0].Visible = false;  
            }  
        } 


    actually in my case, I have two menu skins. one for the home page, and one for the 4 other themes. I realize that I COULD have just dropped the menu css file into each theme, but they all share the same skin for the menu, and switching from theme to theme would mean the browser would have to download everything again. using this method, I place the shared menu in a separate css folder and reference it only when necessary (using visible=true) that way all themes will share the same images and css and will be cached by the browser.

    not bad, I am really digging that cssfilelink control!
  16. Sean
    Sean avatar
    271 posts
    Registered:
    31 May 2006
    29 Aug 2008
    Link to this post
    Glad you got that sorted but one small question, the whole idea behind this thread was to use the RadStylesheetManager's ability to combine scripts, but surely the CssLink control doesn't achieve that does it?
  17. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    29 Aug 2008
    Link to this post
    oh well I meant the built in radcontrol css sheets. apparently the new menu has to have the css added manually, so when I updated I had to do this workaround... and the only way to embed those css is to put them in an assembly which seems like a lot of work.
Register for webinar
17 posts, 0 answered