Including custom StyleSheets as WebResources to RadStyleSheetManager

15 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1679 posts
    Member since:
    Oct 2004

    Posted 23 May 2008 Link to this post

    Requirements

    RadControls version

    Telerik.Web.UI (Q1 2008 +)

    .NET version

    3.5

    Visual Studio version

    2008

    programming language

    C#

    browser support

    all browsers supported by RadControls


     
  2. PROJECT DESCRIPTION

    This is the accompanying project of the help topic on
    Including custom StyleSheets as WebResources to RadStyleSheetManager.

    It shows how RadStyleSheetManager can be used to read css resource information from assemblies and output a single <link> tag to the page HTML. As a specific example, I add the Telerik skin for RadCombobox as a WebResource assembly to the project. For a step-by-step guide, please refer to the help topic.
  • Telerik Admin
    Telerik Admin avatar
    1679 posts
    Member since:
    Oct 2004

    Posted 05 Aug 2009 Link to this post

    A WinForms tool for creating embedded custom skins to be used with RadStyleSheetManager is now available at:

    Tool for Embedding Custom Skins into an Assembly
  • Johan
    Johan avatar
    20 posts
    Member since:
    Dec 2010

    Posted 25 Jan 2011 Link to this post

    1 line method doesn't work anymore (Telerik.Web.UI.dll 2010.3.1215.40)
    Only seems to work if you explicitly specify the controls
  • Simon
    Admin
    Simon avatar
    2281 posts

    Posted 31 Jan 2011 Link to this post

    Hello Johan,

    I just tested the method and it still works with v2010.3.1215.

    Can you please be a bit more specific? What do you mean by explicitly specifying the controls? 

    All the best,
    Simon
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  • Johan
    Johan avatar
    20 posts
    Member since:
    Dec 2010

    Posted 31 Jan 2011 Link to this post

    Hi Simon,
    see
    Home / Community / Forums / ASP.NET AJAX > SkinManager > Does RadSkinManager work with custom (non-embedded) skins?

    Currently I cannot build the project in
    anymore. It is vs2008 and I get build errors (Telerik not found).
    When I try to build a new rad web project I get

    ---------------------------

    Microsoft Visual Studio

    ---------------------------

    Error executing custom action Telerik.Web.UI.VSX.Actions.UnfoldFilesAction:

    Could not find file 'C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Telerik\Telerik WebUI VSExtensions\2010.3.1214.0\ControlScenarios\General\TelerikEnabledWebForm\Default.aspx.t4'.

    ---------------------------

    OK

    ---------------------------

    After re-installing telerik components I will try to create a new project and test it and get back to you.

    regards,
    Johan

     

     

  • Johan
    Johan avatar
    20 posts
    Member since:
    Dec 2010

    Posted 31 Jan 2011 Link to this post

    Okay, I'm back. I installed 2010.3.1317.40 and created a RadControls Web Application in VS2010. I created a skin TestSkin001 with the visual style builder at stylebuilder.telerik.com and created an assembly TestSkin001Assembly.dll file with WebResourceAutoBuilder and put it in the bin folder of my project. Now I have a page with a radcalendar and a radcombobox in them. Both have

    Skin

     

     

    ="TestSkin001" EnableEmbeddedSkins="False"

     

    If I register them like this:

     

     

    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">

     

     

     

    <StyleSheets>

     

     

     

    <telerik:StyleSheetReference Name="TestSkin001Assembly.TestSkin001.Calendar.TestSkin001.css" Assembly="TestSkin001Assembly" />

     

     

     

    <telerik:StyleSheetReference Name="TestSkin001Assembly.TestSkin001.ComboBox.TestSkin001.css" Assembly="TestSkin001Assembly" />

     

     

     

    </StyleSheets>

     

     

     

    </telerik:RadStyleSheetManager>

     

    this works fine,

    but if I register with a single line, like this:

     

     

    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">

     

     

     

    <StyleSheets>

     

     

     

    <telerik:StyleSheetReference Name="TestSkin001Assembly.TestSkin001.css" Assembly="TestSkin001Assembly" />

     

     

     

    </StyleSheets>

     

     

     

    </telerik:RadStyleSheetManager>

     


    this does not work. What is wrong?

    If you want I can send you the project but need an email address or upload fascility.

    regards,
    Johan

  • Simon
    Admin
    Simon avatar
    2281 posts

    Posted 13 Feb 2011 Link to this post

    Hello Johan,

    Perhaps the generic .css file does not exist in the assembly. Can you verify with FireBug or Fiddler whether the Telerik.Web.UI.WebResource.axd response is OK?

    In any case, a sample project showing this issue will help me find the cause of the issue easier. Please send a project via a support ticket (and also mention this Code Library project).

    Regards,
    Simon
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  • Eric
    Eric avatar
    2 posts
    Member since:
    Apr 2009

    Posted 22 Mar 2011 Link to this post

    Great tool! Easily converted Bryan's project to VS2010.
    I actually downloaded several zip files from VisualStyleBuilder, modified them and zipped them all back up together.
    Only problem I had was I noticed some WebResource 404 errors and images were not coming up.

    Turns out the Menu skin generated from VisualStyleBuilder contained css with WebResources in it which caused an error when I used Bryan's project.

    So if you are getting 404 errors or missing styelsheets/images then make sure to search your downloaded css files for content like:

    .RadMenu_CustomSkin .rmRootGroup,
    .RadMenu_CustomSkin .rmFirst,
    .RadMenu_CustomSkin a.rmLink,
    .RadMenu_CustomSkin .rmText,
    .RadMenu_CustomSkin .rmLeftArrow,
    .RadMenu_CustomSkin .rmRightArrow,
    .RadMenu_CustomSkin .rmTopArrow,
    .RadMenu_CustomSkin .rmBottomArrow
    {
        background-image: url(<%= WebResource("CustomSkin.CustomSkin.Menu.rmSprite.png") %>);
    }

    and replace with something like:

    .RadMenu_CustomSkin .rmRootGroup,
    .RadMenu_CustomSkin .rmFirst,
    .RadMenu_CustomSkin a.rmLink,
    .RadMenu_CustomSkin .rmText,
    .RadMenu_CustomSkin .rmLeftArrow,
    .RadMenu_CustomSkin .rmRightArrow,
    .RadMenu_CustomSkin .rmTopArrow,
    .RadMenu_CustomSkin .rmBottomArrow
    {
        background-image: url('Menu/rmSprite.png');
    }

    Then zip it all back up and use Bryan's tool to embed your files into a dll.

    Eric
  • Prashant
    Prashant avatar
    7 posts
    Member since:
    Jun 2011

    Posted 21 Jun 2011 Link to this post

    Downloaded the .zip, unzipped and built the project (I have both VS2008 and VS2010 on my laptop). I cannot find the Telerik.Charting.dll and Telerik.Charting.xml files. When I run the project I figured I would get a complaint about the Charting dll and not:

     

    Server Error in '/' Application.

    Could not load file or assembly 'Telerik.Web.UI, Version=2008.1.515.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)



    OK. So what am I doing wrong?

    Thanks,
    Doug
  • Simon
    Admin
    Simon avatar
    2281 posts

    Posted 23 Jun 2011 Link to this post

    Hi Douglas,

    Thank you for letting us know about the issue.

    There is a hard-coded version of the Telerik.Web.UI assembly in the web.config of the project. This triggers the error when you deploy another version.

    I modified the project so that this specific reference is more general. Please download it again to get the updated version.

    Best wishes,
    Simon
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  • Niels
    Niels avatar
    3 posts
    Member since:
    Dec 2009

    Posted 26 Jul 2011 Link to this post

    nevermind
  • Sarulatha
    Sarulatha avatar
    12 posts
    Member since:
    Mar 2012

    Posted 20 Mar 2012 Link to this post

    Hello Simon,

                            I have created the Separate Class library and added the css/Images. When I have built this class library and added the .dll with my project file. My project is loaded I am not able to apply the css which is availablbe in the class library.


    From the master page I have created a child page, for that child page I am not able to apply the .css and the images are also not loaded in the specific child page.


    Here is the code in Master page:-


    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">

            <StyleSheets>

    <telerik:StyleSheetReference Name="NispCSSAssembly.Button.Default.css"

                    Assembly="NispCSSAssembly"></telerik:StyleSheetReference>

    </StyleSheets>

    </telerik:RadStyleSheetManager>

     

     

    The code of .css image reference:-

     

    background-image:url('<%=WebResource("NispCSSAssembly.Button.ButtonSprites.gif")%>');

     

    Please help me out in this issue.

    Regards,

    Subbu

  • Simon
    Admin
    Simon avatar
    2281 posts

    Posted 21 Mar 2012 Link to this post

    Hi Sarulatha,

    Please submit your query via the support ticketing system because we will need a sample project to help you resolve the problem you are facing. This thread discusses the Code Library Project itself - the solution and code.

    Regards,
    Simon
    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.
  • Boris
    Boris avatar
    275 posts
    Member since:
    Oct 2012

    Posted 13 Nov 2012 Link to this post

    Is there a version of the demo ready to run in VS2012?
  • Kate
    Admin
    Kate avatar
    1898 posts

    Posted 16 Nov 2012 Link to this post

    Hello Boris,

    With our latest official version of the Telerik controls - 2012.3.1016.40 - you can run the live demos in VS 2012.  

    Regards,
    Kate
    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.
  • Back to Top