Microsoft Visual Studio & ASP.NET MVC 3: Add jQuery IntelliSense support for Razor pages

To enable Visual Studio’s IntelliSense support for jQuery on Razor pages just add the following code line to your view:

@if (false) { <script src="~/Scripts/jquery-1.4.4-vsdoc.js" type="text/javascript"></script> }

Note: The if-statement prevents the script tag from being rendered into the html source code.

Unfortunately, with the Razor view engine, there is no central place to add the reference to the vsdoc file, instead you need to add this code line to each view separately to enable the IntelliSense support for jQuery.

Comments

  1. Perry

    Thanks, that was bugging me. Much easier to code with the intellisense in there.

  2. Örvar

    Thanks alot : )

Leave a comment

Your email address will not be published. Required fields are marked *

*