Feb 26, 2010

ScriptManager & Scripts from CDN such as AJAX Library

With roll out of ASP .Net AJAX Library, adding ajax capabilities in scripts is nothing but a link to CDN:


<script src="http://ajax.microsoft.com/ajax/beta/0911/Start.debug.js" type="text/javascript" > </script >

It will load all scripts needed for ajax development regardless of .Net Framework. However if asp:ScriptManager is also used, it will load script from framework. That will cause some visioning problems, and it is the case for sharepoint pages(this seemingly only happens if usng dataview control). SharePoint 2010 master page has ScriptManager embedded and is used by both site pages and application pages . As currently in beta, the workaround is to locally include MicrosoftAjax.js (see here for details).

Another cool thing about ScriptManage or ScripManagerProxy is its asp:serviceReference, it will inject a proxy script class on fly to allow client script to call backend ajax enabled WCF service.