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

Forums / General Discussions / Where do the CSS styles from WebResource.axd come from?

Where do the CSS styles from WebResource.axd come from?

17 posts, 0 answered
  1. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    07 Sep 2010
    Link to this post
    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.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    07 Sep 2010
    Link to this post
    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
    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. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    07 Sep 2010
    Link to this post
    Oh I see. So I guess I just have to edit my CSS styles then. Thanks! :)
  4. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    04 Nov 2010
    Link to this post
    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?
  5. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    04 Nov 2010
    Link to this post
    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
    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. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    09 Nov 2010
    Link to this post
    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?
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    09 Nov 2010
    Link to this post
    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:



    There is an extension method that you can use to determine whether you are in design mode or not - IsDesignMode(), so you can disable embedded resources of a control. You can also take a look at our designers guide.

    Greetings,
    Ivan Dimitrov
    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
  8. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    10 Nov 2010
    Link to this post
    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. :(
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    10 Nov 2010
    Link to this post
    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

    • IsPreviewMode- determines whether the control is in Sitefinity preview mode.
    • IsBackend -determines whether a control instance is in backend.

    Regards,
    Ivan Dimitrov
    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
  10. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    11 Nov 2010
    Link to this post
    Hi Mr. Ivan, if it would be possible, could you provide me a sample implementation for this? I would appreciate it very much. Thanks :)
  11. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    12 Nov 2010
    Link to this post
    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;
               }
           }
       }



    Greetings,
    Ivan Dimitrov
    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
  12. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    15 Nov 2010
    Link to this post
    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?
  13. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    15 Nov 2010
    Link to this post
    Hello jkregala,

    IsDesignMode is a control extension from System.Web.UI.ControlExtensions namespace.

    Kind regards,
    Ivan Dimitrov
    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
  14. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    17 Nov 2010
    Link to this post
    Negative, sir. It didn't work.
  15. jkregala
    jkregala avatar
    159 posts
    Registered:
    22 Sep 2009
    21 Dec 2010
    Link to this post
    Hello.

    I would just like to ask. Is this article still applicable to RC?
  16. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    21 Dec 2010
    Link to this post
    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
    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
  17. higgsy
    higgsy avatar
    336 posts
    Registered:
    05 Aug 2010
    13 Jan 2011
    Link to this post
    @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
17 posts, 0 answered