More JavaScript Intellisense goodies: another great reason to use ScriptManager

I have been tinkering with different JavaScript Intellisense scenarios in Visual Studio 2008.  I just stumbled onto a feature I did not know existed thanks to an internal discussion.  First, if you use a ScriptManager in your page to reference other JavaScript files and service references like so:

MyPage.aspx:

<asp:ScriptManager ID="ScriptManager1" runat="server">
                <Scripts>    
                    <asp:ScriptReference Name="PreviewScript.js"
                        Assembly="Microsoft.Web.Preview" />
                    <asp:ScriptReference Path="MyPage.aspx.js" />
                </Scripts>
                <Services>
                    <asp:ServiceReference Path="OfficesService.svc" />
                </Services>
            </asp:ScriptManager>

Next, if you like to put all of your JavaScript in a separate "code beside" like I do, then all you have to do is reference MyPage.aspx in MyPage.aspx.js like so:

/// <reference path="MyPage.aspx" />

Once you have done this, you will get JavaScript Intellisense in MyPage.aspx.js for everything that was referenced in your ScriptManager.  Now if you add a reference to the ScriptManager, you automatically get JavaScript Intellisense in your "code beside" .js file.  Before I found this feature, I would add duplicate "/// <reference/>" entries in my MyPage.aspx.js file corresponding to the entries in my ScriptManager.  It was a maintenance hassle as references changed.  Problem solved:). 

This entry was posted in Visual Studio 2008. Bookmark the permalink.

3 Responses to More JavaScript Intellisense goodies: another great reason to use ScriptManager

  1. Unknown says:

    wow gold wow gold wow gold wow power leveling wow power leveling wow power leveling wow power leveling World of Warcraft Gold wow gold wow power leveling wow gold wow gold wow gold wow power leveling wow power leveling Rolex Replica rolex Rolex Replica rolex Rolex 租房 租房 北京租房 北京租房 changyongkuivip

  2. Unknown says:

    Hi,Do you have used lcd screens, lcd monitor used, surplus lcds and scrap LCDs? Please go here:www.sstar-hk.com(Southern Stars).We are constantly buying re-usable LCD panels.The re-usable panels go through strictly designed process of categorizing, checking, testing, repairing and refurbishing before they are re-used to make remanufactured LCD displays and TV sets.Due to our recent breakthrough in testing and repairing technology of LCD, we can improve the value for your LCD panels.
    website:www.sstar-hk.com[eafhiiaffjihcbd]

Comments are closed.