Enable ECMA IntelliSense Sandboxed Visual WebPart…!!!
When working in Visual Studio we really a lot upon intelisense. Recently I started working on some SharePoint Online related work with ECMA Scripts and was finding very difficult to survive without VS intelisense.
There are many blog posts and articles that illustrate how to enable intellisence in VS for ECMA Scripting. But most of them are not working with Sandboxed solutions and specifically with Sandboxed Visual Web Part (the template comes with SharePoint Power Tools)
So struggling for some time I was able to figure out how to enable it on Sandboxed Visual Web parts.
1) Create the Sandboxed Visual Web Part from the VS Item template.
2) Add following entries just after the control registrations of the ascx file.
<% #if SOME_UNDEFINED_CONSTANT %>
<% #endif %>
3) Start a new script tag below the above declarations as given below.
<script type=”text/ecmascript” language=”ecmascript”>
4) Write down your code with intellisence support inside the above script block.