In SharePoint 2010 I have a visual web part that uses SP.UI.ModalDialog.showModalDialog
The dialog shows up fine but when I try to close the dialog using
SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.OK, someValue)
I get an error that says
Unable to get value of the property ‘OK’: object is null or undefined
Thanks, I was able to get this to work using numbers instead of SP.UI.DialogResult.OK.
For example…
SP.UI.ModalDialog.commonModalDialogClose(0,'Canceled the dialog.');is like using SP.UI.DialogResult.cancelSP.UI.ModalDialog.commonModalDialogClose(1,'Yay Success!');is like using SP.UI.DialogResult.OKSP.UI.ModalDialog.commonModalDialogClose(-1,'Uh oh... Error');is like using SP.UI.DialogResult.invalid