Search This Blog

Friday, January 2, 2009

JQuery with Asp.net and Visual Studio 2008 intellisense

JQuery with Asp.net and Visual Studio 2008 intellisense

Here is a small post on Jquery which is a far better alternative to Aspnet Ajax.Its a small JavaScript library with immense power and most widely used these days.A few months ago Microsoft announced that they will be shipping JQuery with Next Release of their Visual Studio i.e Visual Studio 2010.

Visual Studio 2010 and .net framework 4.0 Community Technology Preview are already available  for download from

http://www.microsoft.com/downloads/details.aspx?FamilyId=922B4655-93D0-4476-BDA4-94CF5F8D4814&displaylang=en

I am not sure about the intellisense support for JQuery and JavaScript in this new version but as Microsoft Promised they will surely ship it in their final release.

As for now with Visual Studio 2008 full intellisense for JQuery is achieved using a .vsdoc.js file.

 

Steps to follow to get full intellisense

  1. Install this Hotfix which will fix many issues for Visual Studio Team Systems 2008 and also enable and enhance you script intellisense if somehow it is disabled or its not coming with many other fixes.

    Download Link :-https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=10826

  2. Jeff King has a very good post describing the second step here.

http://blogs.msdn.com/webdevtools/archive/2008/10/28/rich-intellisense-for-jquery.aspx

Here a hack is applied so there two files are given one is "jquery-1.2.6.js" another is "jquery-1.2.6-vsdoc.js".So the first file is the actual Jquery file which should be downloaded on the clients browser along with the markup whereas second file should only be available while using intellisense inside the Visual Studio 2008.The markup comments shown above are achieving the same thing.

A very simple Visual Studio Solution is attached at the end of this post for you to see the architecture of how to include jquery files and how to do very basic things using Jquery in an aspx page having basic markup as HTML.

After following these steps you are now ready to start Jquery development in Asp.net

Download Source Code Here :-http://9wtpog.bay.livefilestore.com/y1pPZ0KF1m2F28wRGe4wQYrbDCyIuWruESEpdlcILrP_8rIkJfe2eTchl6iw6KSUMwRroVAQ2UvoCo/JqueryIntellisenseInstallation.rar?download

1 comment:

.Net Development said...

This is very helpful. Thank you

 
ss_blog_claim=610c329374fdaea5e07dfca1c6dffb2d