Try Now
More in this section

Forums / Developing with Sitefinity / Using WebResources in user controls

Using WebResources in user controls

2 posts, 0 answered
  1. higgsy
    higgsy avatar
    336 posts
    05 Aug 2010
    22 Aug 2010
    Link to this post

    I've developed a number of user controls for my sitefinity project - the problem I keep coming up against is that each control requires some javascript / css.

    Rather than include all of the javascript / css in global site-wide files, I would like to explore whether it is possible to use embedded resources and WebResources. I can see that Sitefinity uses this approach itself.

    Is it possible to do this? From what I've read, it's only possible when an external assembly is included, i.e. a seperate Web application project external to my Sitefinity web project. Is this correct?

    Thanks in advance
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    25 Oct 2016
    22 Aug 2010
    Link to this post
    Hi Alastair,

    You can create a custom class library and add your css/js as embedded resources. You have to add your controls in this class library and make reference to the embedded js. Another option is using a separate server to store these scripts - CDN, so that the data will not be stored on your server.

    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
2 posts, 0 answered