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

Forums / Designing with Sitefinity / Master Pages + JavaScript

Master Pages + JavaScript

7 posts, 0 answered
  1. Michael
    Michael avatar
    11 posts
    Registered:
    03 Jan 2008
    16 Nov 2010
    Link to this post
    Hey all,

    I'm just getting my feet wet with a demo version of 3.7.  I have several Master pages that I've uploaded and everything seems to be okay, but I run into a problem when I have pages in a nested directory.

    So for example, in the head I have the following link to jquery:

    <script src="script/jquery-1.4.2.js" type="text/javascript"></script>

    This works fine with pages that utilize this master page at the root level, examples:
    /page1.aspx
    /page2.aspx

    When my pages utilize the master page from a nested directory, the link breaks, for obvious reasons, examples:
    /somedir/page1.aspx
    /somedir/page2.aspx

    Now a quick hack is to duplicate my Script folder that holds my javascript files in the root, create the nested directory manually (in this case; somedir) and plop them in there.  What would be a more elegant resolution to my problem?  Thanks!
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    16 Nov 2010
    Link to this post
    Hi Michael,

    Use a server control or JsFileLink control

    <telerik:JsFileLink runat="server" ID="JsFileLink1" FileName="~/Scripts/js/jquery-1.3.2.min.js" ScriptType="Custom"/>

    Another option is using the cloud storage of jQuery.

    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
  3. Michael
    Michael avatar
    11 posts
    Registered:
    03 Jan 2008
    17 Nov 2010
    Link to this post
    I don't see that control in the "RadControls" section when I try to edit the Master Page.  Is it because I'm on a trial version...?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    17 Nov 2010
    Link to this post
    Hello Michael,

    This is not a RadControl, this is Sitefinity's control that comes from Telerik.Cms.Web.UI assembly. The namespace is the same.

    Sincerely yours,
    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
  5. Michael
    Michael avatar
    11 posts
    Registered:
    03 Jan 2008
    17 Nov 2010
    Link to this post
    Ah, I see now from the API documentation.

    Sorry for the stupid questions, but I'm just evaluating your product...so I should dig through the API documentation and add controls that way?  Why aren't they included from the GUI?  Is it because these are seen as more developer tools rather than business user?

    Thanks for the help!
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    17 Nov 2010
    Link to this post
    Hello Michael,

    This controls is supposed to be used by developers in custom controls. Of course you can wrap them in a user or custom control which will allow you to drag/drop the controls from the toolbox. We have similar controls in Sitefinity 4.0 edition.

    Sincerely yours,
    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
  7. Michael
    Michael avatar
    11 posts
    Registered:
    03 Jan 2008
    17 Nov 2010
    Link to this post
    Okay, thanks for your help!
Register for webinar
7 posts, 0 answered