Try Now
More in this section

Forums / Developing with Sitefinity / Adding JavaScript to the <head> section from a UserControl

Adding JavaScript to the &lt;head&gt; section from a UserControl

2 posts, 0 answered
  1. Steve .
    Steve . avatar
    14 posts
    14 Apr 2010
    08 Jan 2011
    Link to this post
    Hi there,

    I'm looking to wrap a Generic Content control, adding a selection of fields to customise settings in a section of JS code. I'd like the JS to appear in the the <head> section of the page.

    My questions are twofold:

    - Can you please point me to an example of wrapping a GenericContent control, with additional fields? I'm using version 3.7SP4. I've noticed that there are several articles on the topic, but I'm not sure which is relevant.

    - Is there a method to insert content (JS) in to the <head> section? If so, where in the UserControl would you call this?

    Any help appreciated.


  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    01 Feb 2016
    12 Jan 2011
    Link to this post
    Hello Steve .,

    You can take a look at the following threads in regards to extending the Content Block control:

    For adding JavaScript reference to the head section you can use the JavaScriptEmbedControl.

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