Sites that are using ASP.NET 3.5 or ASP.NET 4.0 Ajax Extensions (The ScriptManager, UpdatePanel and other controls) may run into a conflict when using version 3.7 of the Windows Live Messenger Web Toolkit. The conflict occurs because ASP.NET Ajax Extensions use a built-in version of Microsoft Ajax runtime which is older than the one used by the Messenger Web Toolkit. The conflict is visible as a script error that is thrown from the Microsoft Ajax JavaScript files that are loaded by the Messenger Web Toolkit.
There is a workaround that is possible for version 3.7 and continuing versions of the Messenger Web Toolkit. When a web application is using Messenger Web Toolkit and needs to use the ASP.NET Ajax Extensions (either version 3.5 or 4.0), the following steps can be taken:
1. Add the following declarations to the Application_Start method in Global.asax:
ScriptManager.ScriptResourceMapping.AddDefinition( "MicrosoftAjax.js", null, new ScriptResourceDefinition { ResourceName = "MicrosoftAjax.js", ResourceAssembly = typeof(ScriptManager).Assembly, Path = "http://www.wlmessenger.net/MicrosoftAjax/0911/MicrosoftAjax.js", DebugPath = "http://www.wlmessenger.net/MicrosoftAjax/0911/MicrosoftAjax.debug.js", CdnPath = "http://www.wlmessenger.net/MicrosoftAjax/0911/MicrosoftAjax.js", CdnDebugPath = "http://www.wlmessenger.net/MicrosoftAjax/0911/MicrosoftAjax.debug.js" });
ScriptManager.ScriptResourceMapping.AddDefinition( "MicrosoftAjaxWebForms.js", null, new ScriptResourceDefinition { ResourceName = "MicrosoftAjaxWebForms.js", ResourceAssembly = typeof(ScriptManager).Assembly, Path = "http://www.wlmessenger.net/MicrosoftAjax/0911/MicrosoftAjaxWebForms.js", DebugPath = "http://www.wlmessenger.net/MicrosoftAjax/0911/MicrosoftAjaxWebForms.debug.js", CdnPath = "http://www.wlmessenger.net/MicrosoftAjax/0911/MicrosoftAjaxWebForms.js", CdnDebugPath = "http://www.wlmessenger.net/MicrosoftAjax/0911/MicrosoftAjaxWebForms.debug.js" });
2. Make sure that the <script> tag that loads the Messenger Web Toolkit loader occurs after the <scriptmanager> tag in the page.
1. Change the <scriptmanager> tag to the following:
<asp:ScriptManager ID="ScriptManager1" runat="server"> <scripts> <asp:ScriptReference Name="MicrosoftAjax.js" Path=" http://www.wlmessenger.net/MicrosoftAjax/0911/MicrosoftAjax.js" /> <asp:ScriptReference Name="MicrosoftAjaxWebForms.js" Path="http://www.wlmessenger.net/MicrosoftAjax/0911/MicrosoftAjaxWebForms.js" /> </scripts> </asp:ScriptManager>
Offir Bakshitz Software Design Engineer Windows Live Messenger Platform Team