Please enable Javascript to correctly display the contents on Dot Net Tricks!

Enable jQuery Intellisense support to MVC3 Razor

Posted By : Shailendra Chauhan, 02 Nov 2012
Updated On : 11 Jun 2014
Total Views : 126,274   
Support : MVC3 & MVC4
 

jQuery intellisense support helps a lot while programming with jQuery. By default Visual Studio doesn't provide us the jQuery intellisense support. We can enable the jQuery intellisense support in Visual Studio with MVC Razor by adding vsdoc.js file to your view like as :

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

The above if-statement prevents the rendering of script tag into the html source code and it used only by the Visual Studio for jQuery intellisense support. To check jQuery intellisense type the $ or $( between your $(document).ready(function() function and you can see the intellisense as shown in fig.

Note

  1. In MVC Razor, there is no central place to add the reference to the vsdoc.js file. We need to add this code line to each every view separately to enable the IntelliSense support for jQuery.

What do you think?

I hope you will enjoy these tricks while programming with Visual Studio. I would like to have feedback from my blog readers. Your valuable feedback, question, or comments about this article are always welcome.

 
Recommended for you
 
About the Author
Hey! I'm Shailendra Chauhan full-time author, consultant & trainer. I have more than 6 years of hand over Microsoft .NET technologies and other web technologies like JavaScript, AngularJS, NodeJS etc. I am an entrepreneur, the founder & chief editor of www.dotnet-tricks.com and www.dotnettricks.com. I am author of most popular e-books for technical Interview on ASP.NET MVC Interview Questions and Answers & AngularJS Interview Questions and Answers & LINQ Interview Questions and Answers.
I have delivered 100+ training sessions to professional world-wide over Microsoft .NET technologies such C#, ASP.NET MVC, WCF, Entity Framework and other mobile technologies such Ionic, PhoneGap, Corodva. Read more...
 
Free Interview Books
 
6 JUN
ASP.NET MVC with AngularJS Development (online)

Mon - Fri (8:30 PM-10:30 PM IST)

More Details
28 MAY
ASP.NET MVC with AngularJS Development (offline)

Sat, Sun (5:00 PM-7:00 PM IST)

More Details
23 MAY
NodeJS Development (online)

Mon - Fri     07:00 AM-09:00 AM IST

7 MAY
NodeJS Development (offline)

Sat, Sun     (10:00 AM-12:00 PM IST)

2 MAY
ASP.NET MVC with AngularJS Development (online)

Mon-Fri     (8:30 PM-10:30 PM IST)

23 APR
ASP.NET MVC with AngularJS Development (offline)

Sat, Sun     8:00 AM-10:00 AM IST)

4 JAN
.NET Development (offline)

Mon-Fri     (9:00 AM-11:00 AM IST)

BROWSE BY CATEGORY
 
SUBSCRIBE TO LATEST NEWS
 
LIKE US ON FACEBOOK
 
+