title: Can't get a basic SP2010 Modal to work
body: <p>I'm migrating a project from SP2007 to SP2010. I want to get a modal popup to work, to open up the New Item window of a list from an aspx page. I can't get the modal to work in the most basic example, and I can't figure out what's going on. </p>
  
  <p>I keep getting the following error if I use Developer Tools and enable Script Debugging:</p>
  
  <pre><code>SCRIPT5022: Sys.ArgumentTypeException: Object of type 'SP.UI.ApplicationPages.CalendarSelector' cannot be converted to type 'Sys.IDisposable'.
  </code></pre>
  
  <p>Here is a code snippet:</p>
  
  <pre><code>&lt;SharePoint:ScriptLink ID="ScriptLink3" Language="javascript" Name="../ProjectFolder/jquery/jquery-1.7.2.min.js" Defer="false" runat="server" /&gt;
  &lt;SharePoint:ScriptLink ID="ScriptLink1" Language="javascript" Name="../ProjectFolder/jquery/jquery-ui-1.8.12.custom.min.js" Defer="false" runat="server" /&gt;
  &lt;SharePoint:ScriptLink ID="ScriptLink4" Language="javascript" Name="../MicrosoftAjax.js" Defer="false" runat="server" /&gt;
  &lt;SharePoint:ScriptLink ID="ScriptLink5" Language="javascript" Name="../SP.debug.js" Defer="false" runat="server" /&gt;
  &lt;SharePoint:ScriptLink ID="ScriptLink6" Language="javascript" Name="../SP.UI.Dialog.js" Defer="false" runat="server" /&gt;
  &lt;script type="text/javascript"&gt;
      function OpenInDialog(title, url) {
          var options = SP.UI.$create_DialogOptions();
          options.title = title;
          options.width = 680;
          options.height = 500;
          options.url = url;
          options.dialogReturnValueCallback = Function.createDelegate(null, ConfirmationCallback);
          SP.UI.ModalDialog.showModalDialog(options);
      }
  
      function ConfirmationCallback(dialogResult, returnValue) {
          if (dialogResult == SP.UI.DialogResult.OK) {
  
          }
      }
  
  
      OpenInDialog('test', 'http://portal.dev.loc/sites/TestSite/_layouts/Test.aspx');
  
  &lt;/script&gt;
  </code></pre>
  
  <p>I keep thinking that the problem is related to SP.UI.Dialog.js, but my reference is correct, and I can't figure out why it isn't working. This is driving me nuts. Any clue what I'm doing wrong?</p>