title: Javascript error when using Messenger Connect client-side library in ASP.NET
body: <p>I'm having a problem implementing the new Messenger Connect functionality inside an existing Sitefinity site to enable client logins using Live IDs.</p>
  
  <p>Namely, when I'm using the following code to implement the client-side functionality:</p>
  
  <pre><code>&lt;head runat="server"&gt;
    &lt;script type="text/javascript" src="http://js.live.net/4.1/loader.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;form runat="server" id="form1"&gt;
      &lt;asp:ScriptManager ID="ScriptManager1" runat="server"/&gt;
      &lt;wl:app
          client-id="&lt;%= ConfigurationManager.AppSettings["wl_wrap_client_id"] %&gt;"
          scope="WL_Profiles.View"
          callback-url="&lt;%= ConfigurationManager.AppSettings["wl_wrap_client_callback"] %&gt;?wl_session_id=&lt;%=SessionId %&gt;"
          channel-url="/channel.htm"&gt;
      &lt;/wl:app&gt;
  </code></pre>
  
  <p>... I get three errors in Firebug that I can't quite identify correctly:</p>
  
  <blockquote>
    <p>Sys.ArgumentTypeException: Object of type 'Sys._Application' cannot be
    converted to type 'Sys.IDisposable'.
    Parameter name: object</p>
  </blockquote>
  
  <p>(in ScriptResource.axd?d=.... line 4993)</p>
  
  <blockquote>
    <p>Sys.Application._doInitialize is not a
    function</p>
  </blockquote>
  
  <p>(in MicrosoftAjaxBase.js line 1)</p>
  
  <blockquote>
    <p>Sys.InvalidOperationException: The
    script 'MicrosoftAjaxGlobalization.js'
    has been referenced multiple times. If
    referencing Microsoft AJAX scripts
    explicitly, set the MicrosoftAjaxMode
    property of the ScriptManager to
    Explicit.</p>
  </blockquote>
  
  <p>(in ScriptResource.axd?d=.... line 984)</p>
  
  <p>The errors are only triggered when I include the <code>loader.js</code> script from js.live.net.</p>
  
  <p><em>EDIT</em>: Seems the errors aren't necessarily triggered in that order. Refreshing the page seems to shuffle those errors and/or introduce other ones, such as a <code>Sys.ParameterCountException</code> in <code>ScriptResource.axd?...</code> on line 1842, for example.</p>