JQuery Intellisense in Visual Studio 2008 - Tip if it's not working in MVC

6. November 2008 12:38 by mmcconnell1618

Microsoft and JQuery have partnered to release an intellisense file for JQuery in Visual Studio 2008. The Visual Web Developer Team Blog has a good post explaining how to use it.

When I follwed the instructions from the blog post I still wasn't seeing intellisense in VS with ASP.NET MVC projects. I tracked the issue down to how I was referencing the script files.

 

This code DOES NOT produce intellisense:

 <script src="/Content/script/jquery-1.2.6.min.js" type="text/javascript"></script>
    <% if (false)
       { %>
       <script src="/Content/script/jquery-1.2.6.min-vsdoc.js" type="text/javascript"></script>
    <%} %> 

 

By adding the "~" character at the beginning of the paths is DOES:

 <script src="~/Content/script/jquery-1.2.6.min.js" type="text/javascript"></script>
    <% if (false)
       { %>
       <script src="~/Content/script/jquery-1.2.6.min-vsdoc.js" type="text/javascript"></script>
    <%} %>

 

Go figure!

 

 

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Code | Open Source Projects | Visual Studio

Comments are closed