Close modal dialog in Sitecore 7.1?

I have a special dialog that opens an ASPX page using the following call:

Sitecore.Context.ClientPage.ClientResponse.ShowModalDialog("/path/to/my/dialog.aspx");

Prior to Sitecore 7.1, I was able to close the modal dialog box and pass the value using the following JavaScript snippet:

if (window.opener) {
  window.opener.top.returnValue = 'success';
}
window.returnValue = 'success';
window.close();

Since the ASPX page is used in my dialog box, I cannot use Sitecore.Context.ClientPage.ClientResponse.CloseWindow();it to close it (since the Sheer UI framework is missing). Unfortunately, my user dialogue is very complicated, and my project timeline does not give me time to rewrite it as a SPEAK UI application.

At the same time, the JavasScript workaround described above stopped working in Sitecore 7.1 as a result of new modal dialogs with jQuery support. I am wondering, does anyone know how to close the Sitecore 7.1 modal dialog and pass in the value?

+3
1

window.top.dialogClose();

.

+5

All Articles