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

How to style customized native dialogs when embdded skins and stylesheets are turned off in web.config

1 Answer 88 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Shukhrat Nekbaev
Top achievements
Rank 1
Shukhrat Nekbaev asked on 06 Oct 2011, 12:56 PM
Hi,

In web.config I've disabled skins and base stylesheets. Next I copied LinkManager.acxs from samples dir, customized it a bit (set ExternalDialogsPath for editor). When it's loaded it is totally not styled. Most likely control figures out itself about web.config setting and does nothing. I my main master page I use RadStyleSheetManager to manually combine all in one file all the css of controls I use in WebApp.

So question is how to style it?
I've tried using RadStyleSheetManager in LinkManager.ascx, but it failed saying that there is one already used on the page. I know about DialogsCssFile with import feature, but this reverts me back from what I'm trying to escape, I dont want to pull all css files separately for all controls inside LinkManager (plus they will get cached on client, which is another hassle). Would be great it I could use RadStyleSheetManager somehow to get this "all in one" url.
Now I'm trying to embed css directly into control using:

<link class="Telerik_stylesheet" rel="stylesheet" type="text/css" href="<%= Page.ClientScript.GetWebResourceUrl(typeof(Telerik.Web.UI.RadEditor), "Telerik.Web.UI.Skins.Default.Editor.Default.css") %>"/>

approach which is also errorprone cause styles added are not in head of that iframe (maybe, but i dont want to use jQuery to move DOM elements from here to head of iframe for that purpose (if it will even work)).

Another approach would be to take all external resources (from Telerik installation folder) and use them on website, but again, those will get cached (which is a good thing) and when I will update Telerik due new release I will have hard times with the old version cached on clients (which will lead to misc problems unless browser cache is cleared). 

Ideally would be if RadStyleSheetManager could provide a mechanism to access this URL (all in one) which I would like to be able to set as DialogCssHandler (opposite to current DialogCssFile, which will do almost the same), would be great if you could have dictionary based caching (like SquishIt library). That might have solved a lot of problems when it comes to use case where most embedded things are turned off for a certain reason and caching of resources for performance needs is taken into account.
Thanks!

1 Answer, 1 is accepted

Sort by
0
Shukhrat Nekbaev
Top achievements
Rank 1
answered on 09 Oct 2011, 07:08 PM
Hi,

those who are facing similar issues check out my current solution. Basically it's a custom css manager that can group styles, cache on server and client, handle PerformSubstitution property. Currently it's the way I see to work with current Telerik controls, where you have turned off skins and embedded styles in web.config, would like to preload everything (with caching) and load styled dialogs.
Note that my goal was to preload LinkManager with styles, for other dialogs you will need to add proper references.

Article is here: http://weblogs.asp.net/evovision/archive/2011/10/09/implementing-a-custom-css-stylesheet-manager-and-taking-advantage-of-caching.aspx
Tags
Editor
Asked by
Shukhrat Nekbaev
Top achievements
Rank 1
Answers by
Shukhrat Nekbaev
Top achievements
Rank 1
Share this question
or