<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Tales from the Evil Empire : IntelliSense</title><link>http://weblogs.asp.net/bleroy/archive/tags/IntelliSense/default.aspx</link><description>Tags: IntelliSense</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>A simple include for ASP.NET</title><link>http://weblogs.asp.net/bleroy/archive/2009/07/09/a-simple-include-for-asp-net.aspx</link><pubDate>Thu, 09 Jul 2009 23:30:55 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7144049</guid><dc:creator>Bertrand Le Roy</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/bleroy/rsscomments.aspx?PostID=7144049</wfw:commentRss><comments>http://weblogs.asp.net/bleroy/archive/2009/07/09/a-simple-include-for-asp-net.aspx#comments</comments><description>&lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 0px 10px 0px 0px; display: inline; border-top: 0px; border-right: 0px" title="(c) 2005 Bertrand Le Roy" border="0" alt="(c) 2005 Bertrand Le Roy" align="left" src="http://weblogs.asp.net/blogs/bleroy/IMG_03402_64755BBB.jpg" width="164" height="244" /&gt; In &lt;a href="http://weblogs.asp.net/bleroy/archive/2009/07/08/are-master-pages-too-complex.aspx"&gt;yesterday’s post&lt;/a&gt;, I alluded to a simple include extension method that I like to use when I don’t care about designer support. In a comment, Andrew asked if I could share the code for it, so here it is.&lt;/p&gt;  &lt;p&gt;I never liked the regular way of including user controls in WebForms and how they require a registration &lt;strong&gt;and&lt;/strong&gt; a declaration, both of which are more verbose than they need to be. A plain #include would work but is a little outdated (and if I’m not mistaken it’s not even available by default in IIS7).&lt;/p&gt;  &lt;p&gt;My Include method is quite similar to MVC’s RenderPartial except that it doesn’t deal with view data. It’s a plain and simple include. Just give it the relative path to a user control:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="background: #ffee62"&gt;&amp;lt;%&lt;/span&gt; &lt;span style="color: blue"&gt;this&lt;/span&gt;.Include(&lt;span style="color: #a31515"&gt;&amp;quot;Header.ascx&amp;quot;&lt;/span&gt;); &lt;span style="background: #ffee62"&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Here’s the code for that extension method:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Web;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Web.UI;

&lt;span style="color: blue"&gt;public static class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IncludeHelper
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;public static void &lt;/span&gt;Include(&lt;span style="color: blue"&gt;this &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Page &lt;/span&gt;page, &lt;span style="color: blue"&gt;string &lt;/span&gt;virtualPath) {
        &lt;span style="color: blue"&gt;var &lt;/span&gt;resolvedPath = &lt;span style="color: #2b91af"&gt;VirtualPathUtility&lt;/span&gt;.Combine(
            &lt;span style="color: #2b91af"&gt;VirtualPathUtility&lt;/span&gt;.GetDirectory(&lt;br /&gt;            page.Request.AppRelativeCurrentExecutionFilePath),
            virtualPath);
        &lt;span style="color: blue"&gt;var &lt;/span&gt;include = page.LoadControl(resolvedPath);
        &lt;span style="color: blue"&gt;using &lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;writer = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;HtmlTextWriter&lt;/span&gt;(page.Response.Output)) {
            include.RenderControl(writer);
        }
    }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;It just resolves the path, loads the control and renders it in place.&lt;/p&gt;

&lt;p&gt;To use that method, just drop the code as a cs file into App_code if you’re using a web site, or just add it to your project otherwise.&lt;/p&gt;

&lt;p&gt;I played with the idea of enabling an anonymous object parameter to set properties on the user control, but I guess if you’re going to do that, the benefits of the helper get dimmer and going with the regular WebForms user control registration and tags is probably just easier (you’ll get IntelliSense on the properties for example).&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7144049" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/bleroy/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/bleroy/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/bleroy/archive/tags/HTML/default.aspx">HTML</category><category domain="http://weblogs.asp.net/bleroy/archive/tags/IntelliSense/default.aspx">IntelliSense</category></item><item><title>Visual Studio patched for better jQuery IntelliSense</title><link>http://weblogs.asp.net/bleroy/archive/2008/11/07/visual-studio-patched-for-better-jquery-intellisense.aspx</link><pubDate>Sat, 08 Nov 2008 05:34:57 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6726221</guid><dc:creator>Bertrand Le Roy</dc:creator><slash:comments>10</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/bleroy/rsscomments.aspx?PostID=6726221</wfw:commentRss><comments>http://weblogs.asp.net/bleroy/archive/2008/11/07/visual-studio-patched-for-better-jquery-intellisense.aspx#comments</comments><description>&lt;p&gt;Jeff King just announced the release of a &lt;a href="http://code.msdn.microsoft.com/KB958502/Release/ProjectReleases.aspx?ReleaseId=1736"&gt;patch&lt;/a&gt; for Visual Studio 2008 that enables the IDE to find the –vsdoc.js file without requiring the developer to reference it.&lt;/p&gt;  &lt;p&gt;To give some context, a documentation file (basically the same file as the runtime script but with &lt;a href="http://weblogs.asp.net/bleroy/archive/2007/04/23/the-format-for-javascript-doc-comments.aspx"&gt;XML documentation annotations&lt;/a&gt;) can be provided to help Visual Studio provide IntelliSense. Until now, you had to reference that extra file explicitly, usually within a server-side &amp;lt;% if %&amp;gt; block so that the file never gets included at runtime.&lt;/p&gt;  &lt;p&gt;Now that this patch shipped, this is no longer necessary and Visual Studio is going to be able to find the –vsdoc.js file for any script file that is referenced, whether that is through a ScriptManager ScriptReference:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="jQueryIntelliSenseScriptReference" border="0" alt="jQueryIntelliSenseScriptReference" src="http://weblogs.asp.net/blogs/bleroy/jQueryIntelliSenseScriptReference_211932DA.png" width="504" height="131" /&gt; &lt;/p&gt;  &lt;p&gt;or using a plain script tag:   &lt;br /&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="jQueryIntelliSenseScriptTag" border="0" alt="jQueryIntelliSenseScriptTag" src="http://weblogs.asp.net/blogs/bleroy/jQueryIntelliSenseScriptTag_1BC6382A.png" width="504" height="256" /&gt; &lt;/p&gt;  &lt;p&gt;or even a reference XML tag:   &lt;br /&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="jQueryIntelliSenseReferenceTag" border="0" alt="jQueryIntelliSenseReferenceTag" src="http://weblogs.asp.net/blogs/bleroy/jQueryIntelliSenseReferenceTag_253EF6A0.png" width="504" height="233" /&gt; &lt;/p&gt;  &lt;p&gt;That makes jQuery IntelliSense as easy as dropping the –vsdoc.js file in the web site next to the main jQuery file (other libraries can easily take advantage of that too of course):   &lt;br /&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="jQueryIntelliSenseFileLocation" border="0" alt="jQueryIntelliSenseFileLocation" src="http://weblogs.asp.net/blogs/bleroy/jQueryIntelliSenseFileLocation_1145640A.png" width="269" height="182" /&gt; &lt;/p&gt;  &lt;p&gt;Pretty sweet.&lt;/p&gt;  &lt;p&gt;The patch can be found here:   &lt;br /&gt;&lt;a title="http://code.msdn.microsoft.com/KB958502/Release/ProjectReleases.aspx?ReleaseId=1736" href="http://code.msdn.microsoft.com/KB958502/Release/ProjectReleases.aspx?ReleaseId=1736"&gt;http://code.msdn.microsoft.com/KB958502/Release/ProjectReleases.aspx?ReleaseId=1736&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The IntelliSense file for jQuery can be downloaded from the jQuery servers (look for the “documentation: Visual Studio” file):   &lt;br /&gt;&lt;a title="http://docs.jquery.com/Downloading_jQuery#Download_jQuery" href="http://docs.jquery.com/Downloading_jQuery#Download_jQuery"&gt;http://docs.jquery.com/Downloading_jQuery#Download_jQuery&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Jeff’s post:   &lt;br /&gt;&lt;a title="http://blogs.msdn.com/webdevtools/archive/2008/11/07/hotfix-to-enable-vsdoc-js-intellisense-doc-files-is-now-available.aspx" href="http://blogs.msdn.com/webdevtools/archive/2008/11/07/hotfix-to-enable-vsdoc-js-intellisense-doc-files-is-now-available.aspx"&gt;http://blogs.msdn.com/webdevtools/archive/2008/11/07/hotfix-to-enable-vsdoc-js-intellisense-doc-files-is-now-available.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Jeff’s other post on using the documentation file:   &lt;br /&gt;&lt;a title="http://blogs.msdn.com/webdevtools/archive/2008/10/28/rich-intellisense-for-jquery.aspx" href="http://blogs.msdn.com/webdevtools/archive/2008/10/28/rich-intellisense-for-jquery.aspx"&gt;http://blogs.msdn.com/webdevtools/archive/2008/10/28/rich-intellisense-for-jquery.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The format for XML doc comments:   &lt;br /&gt;&lt;a title="http://weblogs.asp.net/bleroy/archive/2007/04/23/the-format-for-javascript-doc-comments.aspx" href="http://weblogs.asp.net/bleroy/archive/2007/04/23/the-format-for-javascript-doc-comments.aspx"&gt;http://weblogs.asp.net/bleroy/archive/2007/04/23/the-format-for-javascript-doc-comments.aspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6726221" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/bleroy/archive/tags/JavaScript/default.aspx">JavaScript</category><category domain="http://weblogs.asp.net/bleroy/archive/tags/IntelliSense/default.aspx">IntelliSense</category><category domain="http://weblogs.asp.net/bleroy/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://weblogs.asp.net/bleroy/archive/tags/jQuery/default.aspx">jQuery</category></item><item><title>jQuery IntelliSense documentation file available</title><link>http://weblogs.asp.net/bleroy/archive/2008/10/27/jquery-intellisense-documentation-file-available.aspx</link><pubDate>Mon, 27 Oct 2008 16:45:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6707287</guid><dc:creator>Bertrand Le Roy</dc:creator><slash:comments>9</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/bleroy/rsscomments.aspx?PostID=6707287</wfw:commentRss><comments>http://weblogs.asp.net/bleroy/archive/2008/10/27/jquery-intellisense-documentation-file-available.aspx#comments</comments><description>&lt;P&gt;IntelliSense documentation files for jQuery just got published on &lt;A href="http://jquery.com/" mce_href="http://jquery.com"&gt;jquery.com&lt;/A&gt;. This enables great IntelliSense at design-time for jQuery in Visual Studio 2008. It goes without saying that this file should only be used at design-time and never at runtime. For the moment, in order to ensure that, you can include the file from an “if (false)” server code block. We’re also working on a much better solution.&lt;/P&gt;
&lt;P&gt;Many, many thanks to John Resig, Scott Cate and Jeff King for making that possible.&lt;/P&gt;
&lt;P&gt;1.2.6: &lt;BR&gt;&lt;A href="http://code.jquery.com/jquery-1.2.6-vsdoc.js" mce_href="http://code.jquery.com/jquery-1.2.6-vsdoc.js"&gt;http://code.jquery.com/jquery-1.2.6-vsdoc.js&lt;/A&gt; &lt;BR&gt;Latest release (currently just a copy of 1.2.6): &lt;BR&gt;&lt;A href="http://code.jquery.com/jquery-latest-vsdoc.js" mce_href="http://code.jquery.com/jquery-latest-vsdoc.js"&gt;http://code.jquery.com/jquery-latest-vsdoc.js&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt; Jeff King wrote a great post explaining how to use the IntelliSense file now and once Visual Studio has been patched (patch will sonn be released).&lt;BR&gt;&lt;A href="http://blogs.msdn.com/webdevtools/archive/2008/10/28/rich-intellisense-for-jquery.aspx"&gt;http://blogs.msdn.com/webdevtools/archive/2008/10/28/rich-intellisense-for-jquery.aspx&lt;/A&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6707287" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/bleroy/archive/tags/JavaScript/default.aspx">JavaScript</category><category domain="http://weblogs.asp.net/bleroy/archive/tags/IntelliSense/default.aspx">IntelliSense</category><category domain="http://weblogs.asp.net/bleroy/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://weblogs.asp.net/bleroy/archive/tags/jQuery/default.aspx">jQuery</category></item><item><title>Late notice: speaking in Montreal tonight</title><link>http://weblogs.asp.net/bleroy/archive/2008/06/02/late-notice-speaking-in-montreal-tonight.aspx</link><pubDate>Mon, 02 Jun 2008 19:14:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6242813</guid><dc:creator>Bertrand Le Roy</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/bleroy/rsscomments.aspx?PostID=6242813</wfw:commentRss><comments>http://weblogs.asp.net/bleroy/archive/2008/06/02/late-notice-speaking-in-montreal-tonight.aspx#comments</comments><description>&lt;P&gt;I'll switch to French for this post as the talk will be in French.&lt;/P&gt;
&lt;P&gt;Je parlerai ce soir devant &lt;A class="" href="http://www.guvsm.net/" mce_href="http://www.guvsm.net/"&gt;le groupe d'usagers de .NET de Montreal&lt;/A&gt; à partir de six heures dans les locaux de Microsoft. Je parlerai de Visual Studio 2008 (et SP1), d'ASP.NET Ajax et du toolkit s'il reste du temps.&lt;/P&gt;
&lt;P&gt;Venez nombreux!&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt; merci à tous ceux qui se sont déplacés, et grand merci&amp;nbsp;au&amp;nbsp;&lt;A class="" href="http://www.guvsm.net/" mce_href="http://www.guvsm.net/"&gt;groupe d'usagers&lt;/A&gt;, à&amp;nbsp;Dominic Sévigny, Guy&amp;nbsp;Barrette&amp;nbsp;et &lt;A class="" href="http://www.runatserver.com/" mce_href="http://www.runatserver.com"&gt;RunAtServer&lt;/A&gt; pour leur accueil.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6242813" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/bleroy/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/bleroy/archive/tags/Atlas/default.aspx">Atlas</category><category domain="http://weblogs.asp.net/bleroy/archive/tags/JavaScript/default.aspx">JavaScript</category><category domain="http://weblogs.asp.net/bleroy/archive/tags/Microsoft+AJAX+Library/default.aspx">Microsoft AJAX Library</category><category domain="http://weblogs.asp.net/bleroy/archive/tags/IntelliSense/default.aspx">IntelliSense</category></item><item><title>The format for JavaScript doc comments</title><link>http://weblogs.asp.net/bleroy/archive/2007/04/23/the-format-for-javascript-doc-comments.aspx</link><pubDate>Tue, 24 Apr 2007 01:18:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:2351780</guid><dc:creator>Bertrand Le Roy</dc:creator><slash:comments>66</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/bleroy/rsscomments.aspx?PostID=2351780</wfw:commentRss><comments>http://weblogs.asp.net/bleroy/archive/2007/04/23/the-format-for-javascript-doc-comments.aspx#comments</comments><description>&lt;P&gt;Xml documentation annotations are going to &lt;A href="http://blogs.msdn.com/webdevtools/archive/2007/03/02/jscript-intellisense-in-orcas.aspx" mce_href="http://blogs.msdn.com/webdevtools/archive/2007/03/02/jscript-intellisense-in-orcas.aspx"&gt;drive JavaScript IntelliSense in Visual Studio Orcas&lt;/A&gt; (the next version of Visual Studio). For more than a year now, we've been including xml doc comments to all public APIs in the &lt;A href="http://ajax.asp.net/" mce_href="http://ajax.asp.net/"&gt;Microsoft Ajax Library&lt;/A&gt;&amp;nbsp;(which are a great place to check out some examples of those comments). We also use the doc comments to automatically&amp;nbsp;generate parameter validation code in&amp;nbsp;the debug version of our&amp;nbsp;scripts.&lt;/P&gt;
&lt;P&gt;The format we've been using is an extension of the &lt;A href="http://msdn2.microsoft.com/en-us/library/b2s063f7.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/b2s063f7.aspx"&gt;format that C# and VB.NET are using&lt;/A&gt; so it should look familiar to .NET developers. The main differences are the additional attributes we added to convey the (optional) type information that is not provided by the language itself and the place where those comments are written.&lt;/P&gt;
&lt;H4&gt;Doc comment position&lt;/H4&gt;
&lt;P&gt;In C# or VB.NET, the doc comment are written before what they describe:&lt;/P&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Summary description for Class1
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Class1
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;
&lt;P&gt;In JavaScript, we decided to put that information *inside* what it describes so that it can be available at runtime: JavaScript has the interesting feature that calling toString on a function returns the code of this function (&lt;A title="which is not the case of the current version of Safari" href="http://bugs.webkit.org/show_bug.cgi?id=11609" mce_href="http://bugs.webkit.org/show_bug.cgi?id=11609"&gt;when it's propertly implemented&lt;/A&gt;), including the comments and thus the doc comments. Here's a similar example in JavaScript where the documentation is written inside of a class constructor:&lt;/P&gt;&lt;PRE class=code&gt;MyNamespace.Class1 = &lt;SPAN style="COLOR: #0000ff"&gt;function&lt;/SPAN&gt;() {
    &lt;SPAN style="COLOR: #008000"&gt;/// &amp;lt;summary&amp;gt;
&lt;/SPAN&gt;    &lt;SPAN style="COLOR: #008000"&gt;/// Summary description for Class1
&lt;/SPAN&gt;    &lt;SPAN style="COLOR: #008000"&gt;/// &amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;
&lt;P&gt;Another difference with C# or VB.NET is that property and event accessors are two different entities in JavaScript. For this reason, we had to choose where the documentation should be for those members. Properties should be documented in the getter and events in the "adder" for this reason:&lt;/P&gt;&lt;PRE class=code&gt;get_myProperty: &lt;SPAN style="COLOR: #0000ff"&gt;function&lt;/SPAN&gt;() {
    &lt;SPAN style="COLOR: #008000"&gt;/// &amp;lt;value&amp;gt;Documentation goes on the getter.&amp;lt;/value&amp;gt;
&lt;/SPAN&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;._myProperty;
},
set_myProperty: &lt;SPAN style="COLOR: #0000ff"&gt;function&lt;/SPAN&gt;(value) {
    &lt;SPAN style="COLOR: #008000"&gt;// No doc comments here
&lt;/SPAN&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;._myProperty = value;
}&lt;/PRE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;STRONG&gt;&lt;FONT size=3&gt;&lt;/FONT&gt;&lt;/STRONG&gt;
&lt;H4&gt;Doc comment tags&lt;/H4&gt;
&lt;H5&gt;The locid attribute&lt;/H5&gt;
&lt;P&gt;Most of the tags that I'm about to describe can have their description text inside of the tag itself or the tag can reference an&amp;nbsp;external&amp;nbsp;description using an identifier as the value of the locid attribute. This of course enables documentation to be localized.&lt;/P&gt;
&lt;P&gt;The choice of the identifier is free but our team is using the following convention (the identifiers are actually being automatically generated by our preprocessor):&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;“T:J#MyNameSpace.MyType” for types &lt;/LI&gt;
&lt;LI&gt;“M:J#MyNameSpace.MyType.myMethod” for methods (use #ctor as the method name for the constructor)&lt;/LI&gt;
&lt;LI&gt;“P:J#MyNameSpace.MyType.myProperty” for properties (in this case the getter would be get_myProperty) &lt;/LI&gt;
&lt;LI&gt;“F:J#MyNameSpace.MyType.myField” for fields &lt;/LI&gt;
&lt;LI&gt;“E:J#MyNameSpace.MyType.myEvent” for events (in this case the adder would be add_myEvent)&lt;/LI&gt;&lt;/UL&gt;
&lt;H5&gt;Type attributes&lt;/H5&gt;
&lt;P&gt;The&amp;nbsp;param, returns, value and field tags that are described below all share the same description of types using attributes. All type information is always optional but you should note that not specifying the type is not the same as specifying type="Object" as everything is not an instance of Object in JavaScript.&lt;/P&gt;
&lt;P&gt;The &lt;STRONG&gt;type&lt;/STRONG&gt; attribute is used to specify the name of the type of the parameter, return value, property or field.&lt;/P&gt;
&lt;P&gt;There are a few cases though where that type is not enough. Namely, in JavaScript, there is no integer type, only a generic Number type. For that reason, and because it's often useful to make that distinction, you can explicitly specify that something is an integer by using both Number as the type and setting the &lt;STRONG&gt;integer&lt;/STRONG&gt; attribute to true:&lt;/P&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: #008000"&gt;/// &amp;lt;field name="index" type="Number" integer="true"/&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;
&lt;P&gt;Similarly, DOM elements don't have a type that's well-defined across all browsers. You can specify that somthing is a DOM element by setting the &lt;STRONG&gt;domElement&lt;/STRONG&gt; attribute to true. No type should be specified in this case.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://research.microsoft.com/SpecSharp" mce_href="http://research.microsoft.com/SpecSharp"&gt;Recent research&lt;/A&gt; shows that non-null types are extremely useful and should probably&amp;nbsp;represent the norm rather than the exception. For that reason, we added the &lt;STRONG&gt;mayBeNull&lt;/STRONG&gt; attribute and made its default value false.&lt;/P&gt;
&lt;P&gt;Finally, if the type is Array, it may be desirable to specify the type of the elements of the array (JavaScript has only one variant array type, there is no int[] or String[]). The &lt;STRONG&gt;elementType&lt;/STRONG&gt;, &lt;STRONG&gt;elementInteger&lt;/STRONG&gt;, &lt;STRONG&gt;elementDomElement&lt;/STRONG&gt; and &lt;STRONG&gt;elementMayBeNull&lt;/STRONG&gt; are the equivalents for the array elements of the type, integer, domElement and mayBeNull attributes.&lt;/P&gt;
&lt;H5&gt;&amp;lt;summary locid="descriptionID"&amp;gt;Description&amp;lt;/summary&amp;gt;&lt;/H5&gt;
&lt;P&gt;The summary tag can be used in a&amp;nbsp;constructor to describe&amp;nbsp;its class, interface or enumeration, or inside a method, property getter or event "adder" to describe respectively the method, property or event.&lt;/P&gt;
&lt;H5&gt;&amp;lt;param name="parameterName"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mayBeNull="true|false" optional="true|false"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; type="ParameterType" parameterArray="true|false"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer="true|false" domElement="true|false"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elementType="ArrayElementType" elementInteger="true|false"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elementDomElement="true|false"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elementMayBeNull="true|false"&amp;gt;Description&amp;lt;/param&amp;gt;&lt;/H5&gt;
&lt;P&gt;The param tag is used to describe the parameters of a method or constructor. The param tags should be in the same order as the method or constructor's parameters and have the same names.&lt;/P&gt;
&lt;P&gt;Optional parameters (which are a way to work around the inexistence of overloads in JavaScript) can be specified using the optional attribute. Optional parameters should come last in the list of parameters and it's good practice to put the "most optional" parameters last.&lt;/P&gt;
&lt;P&gt;The parameterArray attribute can be used on the last parameter to specify that this parameter may be repeated as many times as the caller desires. A typical example of this is &lt;A href="http://ajax.asp.net/docs/ClientReference/Global/JavascriptTypeExtensions/StringTypeExt/StringFormatFunc.aspx" mce_href="http://ajax.asp.net/docs/ClientReference/Global/JavascriptTypeExtensions/StringTypeExt/StringFormatFunc.aspx"&gt;String.format&lt;/A&gt;, which&amp;nbsp;can take&amp;nbsp;as many arguments as the format string enables.&lt;/P&gt;
&lt;H5&gt;&amp;lt;returns&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; type="ValueType" integer="true|false" domElement="true|false"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mayBeNull="true|false" elementType="ArrayElementType"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elementInteger="true|false" elementDomElement="true|false"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elementMayBeNull="true|false"&amp;gt;Description&amp;lt;/returns&amp;gt;&lt;/H5&gt;
&lt;P&gt;The returns tag is used to describe the return value of a method. It should be used only if the function returns a value (in other words if it contains a return statement that is not just "return;").&lt;/P&gt;
&lt;H5&gt;&amp;lt;value&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; type="ValueType" integer="true|false" domElement="true|false"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mayBeNull="true|false" elementType="ArrayElementType"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elementInteger="true|false" elementDomElement="true|false"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elementMayBeNull="true|false"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; locid="descriptionID"&amp;gt;Description&amp;lt;/value&amp;gt;&lt;/H5&gt;
&lt;P&gt;The value tag describes a property (which shouldn't have a summary tag).&lt;/P&gt;
&lt;H5&gt;&amp;lt;field name="fieldName" type="FieldType"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; integer="true|false" domElement="true|false" mayBeNull="true|false"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elementType="ArrayElementType" elementInteger="true|false"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; elementDomElement="true|false" elementMayBeNull="true|false"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; locid="descriptionID"&amp;gt;Description&amp;lt;/field&amp;gt;&lt;/H5&gt;
&lt;P&gt;The field tag (which doesn't exist in C# and VB.NET because in those languages the summary tag can be used) is used inside of a class, interface&amp;nbsp;or enumeration&amp;nbsp;constructor to describe a field. A field can't be described near the field itself in JavaScript because the field itself doesn't have a body to contain that description.&lt;/P&gt;
&lt;H5&gt;&amp;lt;reference path="path/to/the/script/reference.js"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; assembly="Assembly.Name" name="ScriptResourceName.js"/&amp;gt;&lt;/H5&gt;
&lt;P&gt;The reference tag is &lt;A href="http://blogs.msdn.com/webdevtools/archive/2007/03/02/jscript-intellisense-in-orcas.aspx" mce_href="http://blogs.msdn.com/webdevtools/archive/2007/03/02/jscript-intellisense-in-orcas.aspx"&gt;used by Visual Studio&lt;/A&gt; to describe a dependency a script has with another script file. This enables the IDE to provide IntelliSense on the namespaces and types that are defined in this other file. This tag should be at the top of the file, outside of any code.&lt;/P&gt;
&lt;H4&gt;The description&lt;/H4&gt;
&lt;P&gt;The contents of the description itself, whether the tag is summary, param, returns, field or value, is described by the exact same convention that works for C# and VB.NET doc comments. It can be plain text or text containing other XML tags, as described here:&lt;/P&gt;
&lt;P&gt;&lt;A title=http://msdn2.microsoft.com/en-us/library/5ast78ax(VS.80).aspx href="http://msdn2.microsoft.com/en-us/library/5ast78ax(VS.80).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/5ast78ax(VS.80).aspx"&gt;http://msdn2.microsoft.com/en-us/library/5ast78ax(VS.80).aspx&lt;/A&gt;&lt;/P&gt;
&lt;H4&gt;What's next?&lt;/H4&gt;
&lt;P&gt;This is the convention we're using to document and enhance our scripts and we encourage you to do the same, &lt;STRONG&gt;whether you use Microsoft Ajax or not&lt;/STRONG&gt; if only to give your users IntelliSense in Visual Studio.&lt;/P&gt;
&lt;P&gt;Similarly, there is no reason why Visual Studio should be the only IDE to handle XML doc comments. We would love it if other IDEs chose to use that format to provide better IntelliSense (or auto-completion).&lt;/P&gt;
&lt;P&gt;In a future post, I'll describe&amp;nbsp;how you can&amp;nbsp;extract those XML documentation comments&amp;nbsp;to build usable documentation&amp;nbsp;using existing tools that&amp;nbsp;were designed for&amp;nbsp;managed code.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt; added the optional attribute for params, which I had omitted.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;UPDATE 2:&lt;/STRONG&gt; &lt;A href="http://sessions.visitmix.com/default.asp?event=1011&amp;amp;session=2012&amp;amp;pid=DEV14&amp;amp;disc=&amp;amp;id=1523&amp;amp;year=2007&amp;amp;search=DEV14" mce_href="http://sessions.visitmix.com/default.asp?event=1011&amp;amp;session=2012&amp;amp;pid=DEV14&amp;amp;disc=&amp;amp;id=1523&amp;amp;year=2007&amp;amp;search=DEV14"&gt;Omar Khan gave a great talk at Mix 07&lt;/A&gt; on the new features in Visual Studio Orcas. Around minute 45, he starts demonstrating JavaScript IntelliSense:&lt;BR&gt;&lt;A href="http://sessions.visitmix.com/default.asp?event=1011&amp;amp;session=2012&amp;amp;pid=DEV14&amp;amp;disc=&amp;amp;id=1523&amp;amp;year=2007&amp;amp;search=DEV14" mce_href="http://sessions.visitmix.com/default.asp?event=1011&amp;amp;session=2012&amp;amp;pid=DEV14&amp;amp;disc=&amp;amp;id=1523&amp;amp;year=2007&amp;amp;search=DEV14"&gt;http://sessions.visitmix.com/default.asp?event=1011&amp;amp;session=2012&amp;amp;pid=DEV14&amp;amp;disc=&amp;amp;id=1523&amp;amp;year=2007&amp;amp;search=DEV14&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;UPDATE 3: &lt;/STRONG&gt;added "J#" to naming convention for the locids, to enable managed code and script to implement the same namespaces without a collision in the locids. Also removed locid from param and returns.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;UPDATE 4:&lt;/STRONG&gt; &lt;A class="" href="http://www.codeplex.com/scriptdoc" mce_href="http://www.codeplex.com/scriptdoc"&gt;ScriptDoc&lt;/A&gt;, the documentation extraction tool that builds xml files from these doc comments for consumption by &lt;A class="" href="http://blogs.msdn.com/sandcastle/" mce_href="http://blogs.msdn.com/sandcastle/"&gt;Sandcastle&lt;/A&gt;, is &lt;A class="" href="http://weblogs.asp.net/bleroy/archive/2007/06/27/scriptdoc-1-0-available.aspx" mce_href="http://weblogs.asp.net/bleroy/archive/2007/06/27/scriptdoc-1-0-available.aspx"&gt;now available&lt;/A&gt; &lt;A class="" href="http://www.codeplex.com/scriptdoc" mce_href="http://www.codeplex.com/scriptdoc"&gt;on Codeplex&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=2351780" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/bleroy/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/bleroy/archive/tags/Atlas/default.aspx">Atlas</category><category domain="http://weblogs.asp.net/bleroy/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/bleroy/archive/tags/JavaScript/default.aspx">JavaScript</category><category domain="http://weblogs.asp.net/bleroy/archive/tags/Microsoft+AJAX+Library/default.aspx">Microsoft AJAX Library</category><category domain="http://weblogs.asp.net/bleroy/archive/tags/IntelliSense/default.aspx">IntelliSense</category></item></channel></rss>