RadControls for ASP.NET AJAX This article shows how to enable the IntelliSense of the embedded in Telerik.Web.UI assembly jQuery library.
jQuery IntelliSense in VS 2010 using RadControls Q2 2011 SP or later
Since the Q2 2011 SP release of RadControls, IntelliSense is automatically enabled when RadScriptManager is on a page.
There is no need to add the previously required ScriptReferences to RadScriptManager to enable IntelliSense:
CopyASPX
<telerik:RadScriptManager runat="server" ID="RadScriptManager1">
<Scripts>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
</Scripts>
</telerik:RadScriptManager>
If you have been using the above references before, you can safely remove them with the new release.
jQuery IntelliSense in VS 2008 using RadControls Q1 2011 or later
Since the Q1 2011 release of RadControls, jQuery IntelliSense does not work with the scripts embedded in the Telerik.Web.UI.dll.
The relevant jQuery scripts can be referenced as external files similarly to the following:
CopyASPX
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
<asp:ScriptReference Path="~/Scripts/jquery-1.5.1.js" />
<asp:ScriptReference Path="~/Scripts/jquery-1.5.1-vsdoc.js" />
</Scripts>
</asp:ScriptManager>
Enable jQuery Intellisense using RadControls Q1 2009 SP1 or higher
1. Install Visual Studio 2008 SP1
2. Install VS 2008 Patch KB958502 to Support "-vsdoc.js" Intellisense Files
3. Add the following script references in your page:
CopyASPX
<asp:ScriptManager runat="server" ID="ScriptManager1">
<Scripts>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
</Scripts>
</asp:ScriptManager> Note |
|---|
IntelliSense will not work if RadScriptManager is used instead of ScriptManager. For all intents and purposes, the reference to the later seems to be hard coded in Visual Studio. So, when you write your code you can use the ScriptManager to get the intellisense working and when ready - replace the ScriptManager with RadScriptManager |
Here is a screenshot:
Enable jQuery Intellisense using RadControls version Q3 2008
1. Install Visual Studio 2008 SP1
2. Install VS 2008 Patch KB958502 to Support "-vsdoc.js" Intellisense Files
3. Download the jQuery IntelliSense documentation file and add it to your project. Rename it to jquery-telerik-vsdoc.js
4. Add a new file to your project, jquery-telerik.js, with the following content:
CopyJavaScript
var jQuery = window.jQuery = window.$ = $telerik.$;
This will make jQuery accessible under its default alias - $.
Make sure that both jquery-telerik.js and jquery-telerik-vsdoc.js are in the same folder.
5. Add script references for jQuery and the jquery-telerik.js file in the ScriptManager on the page:
CopyASPX
<asp:ScriptManager ID="ScriptManager" runat="server">
<Scripts>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
<asp:ScriptReference Path="~/jquery-telerik.js" />
</Scripts>
</asp:ScriptManager>
//
See Also