06 April 2009

jQuery Intellisense in VS 2008

I have been working with the jQuery in VS 2008 and I needed jQuery intellisense support.
Since the process in not straightforward, I decided to document it here:
1) Install VS 2008 SP1
2) Install VS 2008 Patch KB958502 to Support "-vsdoc.js" Intellisense Files
You can download it for here
3) Download the jQuery-vsdoc.js from the official download page here
Use the Documentation: Visual Studio link.
4) Save the jquery-vsdoc.js file in the same folder of the jquery.js file in your project and make sure its naming prefix matches the jquery file name
5) There is no intellisense support in user controls (ascx) unless the jQuery.js file is included. Since normally we don't want to include the jQuery file in the ascx there is a workaround:


<% if (false) {%>
<% script src="js/jquery.js" type="text/javascript"><% /script>
<% } %>


For more information:
jQuery Intellisense in VS 2008