Server Control Embedded Resources on live server - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Server Control Embedded Resources on live server

  • Server Control Embedded Resources on live server
  • I have created a server control that embeds the images and css into the resource file. I have made sure that the following is true:

    resources are marked as embedded resource
    I have included them in the assemblyinfo.cs 
    I have put the <%= Webresource("Namespace.Resource.path")%> reference into the css
    I have included a ResourceLinks control to embed the css in the page
    I have tried both UseEmbeddedThemes set to true and false

    On localhost, It resolves resources properly. The control works as expected in all aspects.  When I move it to production, It is not resolving the resources into the WebResource.axd url as expected, but instead uses the namespace path specified in the css. 

    Any thoughts on this? I have looked at it too long. I hate when my developers tell me "Well, it works on my machine".


  • Hi John Tolar,

    You have to set Static property of the Resource file to true:
    Copy Code
    <sitefinity:ResourceLinks runat="server">
        <sitefinity:ResourceFile Name="SocialWidgetsContrib.Resources.SocialWidgetsContrib.css" AssemblyInfo="NewsRotator.Rotator, NewsRotator" Static="true" />

    Static resources will not be pulled from the theme folder, but rather a full URL for external or full resource name for embedded resources should be used.

    Kind regards,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.