SharePoint enabling ECMA Client Object Model IntelliSense for a Visual Web Part

Adding  following lines at the start of the .ascx file in a visual webpart enables Intellisense in Visual Studio while writing ECMA code.

<script type="text/javascript" src="/_layouts/MicrosoftAjax.js"></script>
<script type="text/javascript" src="/_layouts/SP.Debug.js"></script>
<script type="text/javascript" src="/_layouts/SP.Core.debug.js">

If reference to SP.Core.debug.js is not included, then we wont get IntelliSense on list objects. Following is the list of debug .js files present in _layouts folder and depending upon the objects you are working with, you may need to add a reference to any of them to get IntelliSense.

·         SP.debug.js
·         SP.Core.debug.js
·         SP.Ribbon.debug.js
·         SP.Runtime.debug.js
·         JsGrid.debug.js
·         JsGrid.Gantt.debug.js
Note: Remember to exclude these references while deploying the code to production server. 

profile for Nadeem Yousuf at SharePoint Stack Exchange, Q&A for SharePoint enthusiasts

+