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

Themes and Custom Skins

1 Answer 142 Views
SkinManager
This is a migrated thread and some comments may be shown as answers.
Joao
Top achievements
Rank 1
Joao asked on 18 Oct 2012, 01:48 PM
Hi,

I've been searching about this for several days but I can't get my head around it.

Just as a note: all of our custom skins were designed using the visual style builder (http://stylebuilder.telerik.com/) but none of them has a .skin file. I couldn't understand yet what is this file for.

I have an application that each user will have a different CUSTOM skin name saved on the database. There will be the same number of users as skins, so if there's 50 users, there will be 50 different skins, one to each user. Everytime the user logs in, the application loads the skin name from the database and applies it to all controls by using a technic described on this blogpost: http://blogs.telerik.com/vladimirenchev/posts/08-07-11/change-skins-dynamically-for-all-telerik-radcontrols.aspx

I converted the C# code into VB and put on the page load of the master page. It looks like this

     Public Sub SetSkin(ByVal target As Control, ByVal skinName As String)
         
        If TypeOf target Is ISkinnableControl Then
 
            Dim skinnableTarget As ISkinnableControl = Nothing
            skinnableTarget = DirectCast(target, ISkinnableControl)
            skinnableTarget.Skin = skinName
 
        Else
 
            For Each child As Control In target.Controls
                SetSkin(child, skinName)
            Next
 
        End If
    End Sub

This works great and as intended when the users are 2 or 3, but when it grows to 20 or 30 users and skins I can see in the source code that all CSS files of all skins are loaded into the page and this creates problems with the IE limitation on number of css includes which I think is 32. I read somewhere that telerik will include all css files inside the theme folder. For example, each Skin have 11 different css files (ajax, button, calendar, grid, etc). If I have 20 different skins I'll have 220 css files included in the page when I need onlye 11.

I also don't know if I should have 1 theme with 1 skin per user
Example
App_Themes\ThemeUser1\SkinYellow
App_Themes\ThemeUser2\SkinGreen
and then programmatically assigned a different theme after each user. This would solve the problem of  to many css files included in the page, but i couldn't find out to assign theme's to the page/controls

or if I should have 1 theme with several skins but find a way to include only the css files of the skin that is gonna be used by the logged user.
Eexample
App_Themes\GenericTheme\SkinYellow
App_Themes\GenericTheme\SkinGreen

Hope this makes sense, please let me know what I should do to solve this problem. Oh, and sorry for such a long post, that's the way I found best to explain the issue.

Regards
Joao

1 Answer, 1 is accepted

Sort by
0
Galin
Telerik team
answered on 23 Oct 2012, 04:04 PM
Hi Joao,


To avoid the 31 stylesheet limitation in IE browser and to improve your performance I can recommend you to build a custom Skin assembly and use the RadStyleSheetManager. Please refer to this pages for more info:
http://www.telerik.com/help/aspnet-ajax/introduction-skins-external-assembly.html
http://www.telerik.com/community/code-library/aspnet-ajax/general/how-to-load-skins-from-external-assemblies.aspx

Additionally, you can use the following tool, which is provided from our customer
http://www.acdevsoftware.ch/Download/Default.aspx?lang=en#TOOLS


Also, It seems you have opened a support ticket concerning the same issue. In order to avoid duplicate posts, I suggest that we continue the communication in the support ticket.

All the best,
Galin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
SkinManager
Asked by
Joao
Top achievements
Rank 1
Answers by
Galin
Telerik team
Share this question
or