Question

I've followed all the steps to get intellisense working for jQuery in VS 2008 SP1 (with the vsdoc hotfix). It works when I reference jQuery inside an asp:ScriptManager control like so:

<asp:ScriptManager runat="server">
<scripts>
...
</scripts>
</asp:ScriptManager>

But I'm using ajax ToolkitScriptManager instead and the intellisense doesn't seem to work when using this control. It offers some better features so I'm not willing to live without it.

It looks like the VS team only programmed the jQuery intellisense to look for asp ScriptManager controls and not ToolkitScriptManager. Has anyone found a workaround for this specific problem?

Cheers

Was it helpful?

Solution

Wows, I, had the same problem and used the following method to trick Visual Studio:

<% if(false) { %>
    <script src="/scripts/jquery-1.3.2.js" type="text/javascript"></script>
<% } %>

The script tag will never be rendered but VS interprets it and enables intellisense.

OTHER TIPS

If the file is contained in your project with a -vsdoc.js at the end, IntelliSense should work. Rick Strahl has a great post about this at http://www.west-wind.com/Weblog/posts/536756.aspx

A different question: why are you putting the JQuery library in the script manager?

The script manager can do some cool things, like compress the javascript files for you -- but that only works if the JavaScript is in a resource file.

Also, using the ScriptManager adds a bunch of extra JavaScript that will not be downloaded by the client (all of the Microsoft AJAX libraries). Which is fine so long as you are using the Microsoft AJAX Toolkit, but is a lot of extra load if you are not.

EDIT: if you want a better relative position get JQuery from Google Code. You can read about it here: http://code.google.com/apis/ajaxlibs/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top