Making the mods
First, you’ll need to install SP1 for Visual Studio 2008 from here: http://www.microsoft.com/downloads/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&displaylang=en . This service pack adds a lot of enhancements to intellisense and other features of visual studio, so it’s useful even if you don’t want js file intellisense.
Then you need to install Microsoft’s hotfix for Visual Studio 2008 from here: http://code.msdn.microsoft.com/KB958502 . This hotfix makes Visual Studio automatically load vs-doc.js files as long as they are in the same folder as the dependent js file.
Place any vs-doc.js files in the same folder as their dependent js file, if you don’t have the vs-doc file for jquery, you can download it here: http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.3.2-vsdoc2.js (you’ll need to remove the 2 at the end of the file name or Visual Studio won’t see it). For example, if you are using jquery-1.3.2.js, be sure to have the jquery-1.3.2-vsdoc.js file in the same folder. But if you’re using jquery-1.3.2.min.js, you’ll need the jquery-1.3.2.min-vsdoc.js file instead.
Note: this must be in the master page, not an include file, and it must use absolute reference, not dynamic Url.Content.
Only some js files will load in intellisense;
some js files cause all the js files to fail to load into intellisense. --->
Here’s why: The Visual Studio hotfix won’t see the intellisense info for your js files in an MVC environment because of the way we need to dynamically fetch the runtime url. You will need to add an absolute url reference, which is why we can’t use the MVC Url.Content method. Additionally, you don’t want that reference to get rendered to the client, hence the “if false” clause the always prevents it from rendering on the client, but tricks Visual Studio into seeing the reference for intellisense. Furthermore, VS2008 won’t see js file references in include files like MasterHeadElement.ascx, it only sees the ref if it is in the master page itself.
One warning: I found that some of the js file references fry the system and prevent all of the js files from loading into intellisense. I’m not sure why, but so far I know that jquery, jquery.blockUI, and json2 always work, but some other js files don’t.