Where do the CSS styles from WebResource.axd come from?
Cont... And how are they generated?
I've created a CSS file to contain all the custom styles for my Sitefinity 4 site and yet my styles keep getting overwritten by certain styles set in a certain WebResource.axd?d=sdkh... (I checked through Firebug) How do I disable this? I'm reusing an old CSS file that works previously on Sitefinity 3.7. It would take a long time to edit the file just to overlap the CSS generated by the annoying WebResource.axd
Thanks in advance.
Hi jkregala,
WebResource.axd are embedded resources that comes from our dlls. These files contain compiled css, js and other files that a given control uses to work properly. By default the embedded resource cannot be removed. Furthermore all RadControls contains essential scripts in them. You can disable the embedded resources for the RadControls, but this will cause some issues.
You can modify your css classes and rules with the proper selectors and use the !important rule when this is necessary.
Best wishes,
Ivan Dimitrov
the Telerik team
Oh I see. So I guess I just have to edit my CSS styles then. Thanks! :)
Hi Ivan Dimitrov, just a follow-up question please.
I understand that these are very important for the CMS interface to appear well however could we do something so that we could disable these resources (especially the ones related to CSS) on the actual live website itself?
Hi jkregala,
You can disable the embedded style sheets are make controls load their styles from your theme. Note however that RadControls for ASP.NET Ajax need their base style sheets for their functionality. If you disable the embedded base style sheets fro those controls you should provide the styling rules from another file. Also note that RadControls for ASP.NET Ajax have CDN for .js files and stylesheets, so instead of loading them from WebResource.asxd you can load them from Telerik's CDN. Please take a look at the following article which explains how to load custom style sheets for Sitefinity content controls.
Greetings,
Radoslav Georgiev
the Telerik team
How about disabling the embedded style sheets only in the public faces of the web application? That means inside Sitefinity I still want to use the base style sheets while the pages that can be seen by the public, the actual "website" itself will have custom stylesheets under our total control?
Hi jkregala,
Building custom skins for RadControls for ASP.NET AJAX in Sitefinity, like using built in skins, is the same as doing so for regular ASP.NET themes. The documentation for RadControls, contains a tutorial on how to create custom skins for each of the controls, it also contains a full list of the CSS skin file selectors that you have to use in order to build your own styling rules. For the RadMenu you can take a look at the following tutorial and article:
From my understanding the only approach that can be done is to disable all embedded scripts/styles and then create custom ones for them (like skins). And that there is no way to limit the loading of these scripts/styles only within the CMS. Am I correct?
Also, I havent found anything about IsDesignMode() in the designer's guide. :(
Hello jkregala,
If you set EnableEmbeddedScripts, EnableEmbeddedSkin and EnableEmbeddedBaseStylesheet to false for your controls when you are in the backend or frontend, but the RadControls will not work properly, because these properties should be set to false in cases when you have custom scripts and styles which will replace the default one, otherwise you will see javascript errors.
IsDesignMode is extension static method which determines whether the control is in Sitefinity design mode - you are editing a page. There are also
Hi Mr. Ivan, if it would be possible, could you provide me a sample implementation for this? I would appreciate it very much. Thanks :)
Hello jkregala,
I do not thing that there are css classes that we load and which could break your controls. The styles that applies over a control comes from your template or these are the styles that are loaded as embedded resources from the control. If you use RadControls for ASP.NET AJAX you can set EnableEmbeddedScripts, EnableEmbeddedSkin and EnableEmbeddedBaseStylesheet when you are in design or preview mode depending on your needs, but as I said you should relevant resources that would ensure that all functions of the control will keep working properly.
public
partial
class
WebUserControl1 : System.Web.UI.UserControl
protected
void
Page_Load(
object
sender, EventArgs e)
if
(
this
.IsDesignMode() &&
this
.IsPreviewMode())
RadTreeView1.EnableEmbeddedSkins =
false
;
RadTreeView1.EnableEmbeddedScripts =
false
;
Hi, we/re trying to put this on our main Master Page file's codebehind but the solution can't pick up the IsDesignMode property. It keeps on saying that it does not exist in the current context. From what namespace is this property from? And on what page could we implement its usage?
Hello jkregala,
IsDesignMode is a control extension from System.Web.UI.ControlExtensions namespace.
Kind regards,
Ivan Dimitrov
the Telerik team
Negative, sir. It didn't work.
Hello.
I would just like to ask. Is this article still applicable to RC?
Hi jkregala,
This is valid if you use RadScriptManager in your controls. We enable an option for using RadScriptManager instead of ASP.NET script manager and we will allow to manage some of the RadScriptManager properties through the configuration for pages. You will be able to see these changes in the weekly internal build that we are going to release later this week.
Best wishes,
Ivan Dimitrov
the Telerik team
@jkregala - did you find a way of disabling these in the front-end i.e. public website only?
My styles are being overwritten by a naughty global h1,h2,h3 etc rule in the embedded resource.
Thanks
higgsy