Click here to Skip to main content
Click here to Skip to main content

Enabling JavaScript intellisense in VS.NET 2010 to work with SharePoint 2010

By , 16 Apr 2010
Rate this:
Please Sign up or sign in to vote.
To enable JS intellisense in Visual Studio 2010, you have two options (there are others to do with reference tag name and assembly) but these are the ones that I know work.
 
i) Add a JavaScript file to an AJAX server control project (which references System.Web.Extensions and hence the embedded resource MicrosoftAJAX.js - you could also probably add an assembly reference to a web.config for the same effect but I haven't tried it).
 
ii) Add the following reference tags to the top of the JS file:
 
/// <reference name="MicrosoftAjax.js"/>
/// <reference path="C:\\path-to-js\\SP.UI.Dialog.debug.js"  />
 
iii) Add JS equivalent 'using' statements to top of JS (below reference) - Type.registerNamespace("SP.Ribbon"); etc.
 
The other way is to add:
 
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    <Scripts>
        <asp:ScriptReference Path="~/SP.UI.Dialog.debug.js" />
    </Scripts>
</asp:ScriptManagerProxy>
<script type="text/javascript">
...script
 </script>
 
to an aspx page.
 
Use Ctrl + Shift + J to update javascript intellisense in visual studio.
 
Adding the debug version is needed because the non debug version is compressed for performance reasons using an older version of Script#.
 

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

e.bonavero-miller

United Kingdom United Kingdom
No Biography provided

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web03 | 2.8.140415.2 | Last Updated 16 Apr 2010
Article Copyright 2010 by e.bonavero-miller
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid