Force JQuery registers

3 posts, 1 answers
  1. Mab CV
    Mab  CV avatar
    8 posts
    Member since:
    Jun 2009

    Posted 05 Feb 2010 Link to this post

    Hi

    Is it possible to force jQuery registers by code behind ?
    I can't add scriptregistering in the aspx file like it is describe in this topic :

    Regards.
    Mab
  2. Answer
    Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 10 Feb 2010 Link to this post

    Hello Mab CV,

    You can add ScriptReferences to the Scripts collection of RadScriptManager or asp ScriptManager from the code-behind using their GetCurrent(page) static methods. Here is some pseudo code that can get you started:

    C#
    ScriptReference sref = new ScriptReference("Telerik.Web.UI.Common.jQuery.js","Telerik.Web.UI");
    ScriptManager.GetCurrent(this.Page).Scripts.Add(sref);

    VB.NET
    Dim sref As ScriptReference = New ScriptReference("Telerik.Web.UI.Common.jQuery.js","Telerik.Web.UI"
    ScriptManager.GetCurrent(this.Page).Scripts.Add(sref)

    More information about asp ScriptManager and its scripts registration mechanism can be gathered from here.

    Best,
    Sebastian
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  3. Mab CV
    Mab  CV avatar
    8 posts
    Member since:
    Jun 2009

    Posted 13 Feb 2010 Link to this post

    It's OK.
    Thanks for the answer.
Back to Top