This is a migrated thread and some comments may be shown as answers.

Force JQuery registers

2 Answers 54 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Mab CV
Top achievements
Rank 1
Mab CV asked on 05 Feb 2010, 10:20 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Sebastian
Telerik team
answered on 10 Feb 2010, 09:31 AM
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.
0
Mab CV
Top achievements
Rank 1
answered on 13 Feb 2010, 09:20 PM
It's OK.
Thanks for the answer.
Tags
Ajax
Asked by
Mab CV
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Mab CV
Top achievements
Rank 1
Share this question
or