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.
I keep getting the following error if I use Developer Tools and enable Script Debugging:
SCRIPT5022: Sys.ArgumentTypeException: Object of type 'SP.UI.ApplicationPages.CalendarSelector' cannot be converted to type 'Sys.IDisposable'.
Here's the relevant code snippet:
<SharePoint:ScriptLink ID="ScriptLink3" Language="javascript" Name="../ProjectFolder/jquery/jquery-1.7.2.min.js" Defer="false" runat="server" />
<SharePoint:ScriptLink ID="ScriptLink1" Language="javascript" Name="../ProjectFolder/jquery/jquery-ui-1.8.12.custom.min.js" Defer="false" runat="server" />
<SharePoint:ScriptLink ID="ScriptLink4" Language="javascript" Name="../MicrosoftAjax.js" Defer="false" runat="server" />
<SharePoint:ScriptLink ID="ScriptLink5" Language="javascript" Name="../SP.debug.js" Defer="false" runat="server" />
<SharePoint:ScriptLink ID="ScriptLink6" Language="javascript" Name="../SP.UI.Dialog.js" Defer="false" runat="server" />
<script type="text/javascript">
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) {
// do whatever needed
}
}
OpenInDialog('test', 'http://portal.dev.loc/sites/TestSite/_layouts/Test.aspx');
</script>
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. Any clue what I'm doing wrong?