Telerik blogs

  UPDATE: Please see this blog post for updated instructions on enabling IntelliSense in the Q1 '09 version.

We have recently announced that we are shipping jQuery with RadControls for ASP.NET Ajax. You can use this completely unmodified version of jQuery in your projects, as long as you have the RadControls assembly in your bin folder. This way you do not have to include jQuery and this can translate into 50kB less traffic.

You can enable IntelliSense, just like with the standalone jQuery, in VS2008 with a few simple steps.

1. Install the Visual Studio 2008 IntelliSense patch, if you have not already done so.

2. Download the jQuery IntelliSense documentation file and add it to your project. Rename it to jquery-telerik-vsdoc.js

3. Add a new file to your project, jquery-telerik.js, with the following content:

var jQuery = window.jQuery = window.$ = $telerik.$;

This will make jQuery accessible under its default alias - $.

Edit: Make sure that both jquery-telerik.js and jquery-telerik-vsdoc.js are in the same folder.

4. Add script references for jQuery and the jquery-telerik.js file in the ScriptManager on the page:

<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>

 

And that is just about it. You can start using jQuery, as you normally would, with full IntelliSense support.

You will find a reference web site attached to this blog post.

Have a great day.

WebUI_jQuery.zip


About the Author

Iana Tsolova

is Product Manager at Telerik’s DevTools division. She joined the company back in the beginning of 2008 as a Support Officer and has since occupied various positions at Telerik, including Senior Support Officer, Team Lead at one of the ASP.NET AJAX teams and Technical Support Director. Iana’s main interests are web development, reading articles related to geography, wild nature and latest renewable energy technologies.

Comments

Comments are disabled in preview mode.