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.
Related posts:
- ASP.NET MVC 3: Set up custom error pages to handle errors in “non-AJAX” requests and jQuery AJAX requests
- ASP.NET MVC 3: Ajax Form with jQuery validate supporting (unobtrusive) Client Side Validation and Server Side Validation
- ASP.NET MVC 3: Using JSON result for jQuery Ajax Forms validation
- ASP.NET MVC 3: Using jQuery .ajax() function to submit Ajax Form supporting (unobtrusive) Client Side Validation and Server Side Validation
- ASP.NET MVC 3: How to get the current controller and action in a Razor view
Thanks, that was bugging me. Much easier to code with the intellisense in there.
Thanks alot : )