문제

I have a custom 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 have been able to close the modal dialog and pass back a value using the following JavaScript snippet:

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

Since my dialog uses an ASPX page, I don't have the luxury of using Sitecore.Context.ClientPage.ClientResponse.CloseWindow(); to close it (since the Sheer UI frameworks are not present). Unfortunately, my custom dialog is very complex, and my project's timeline does not afford me the time to rewrite it as a SPEAK UI application.

That being said, the above JavasScript workaround has stopped working in Sitecore 7.1 as a result of the new jQuery-powered modal dialogs. I am wondering if anyone knows how to close a Sitecore 7.1 modal dialog and pass back a value?

도움이 되었습니까?

해결책

You can call window.top.dialogClose();

That should do the trick.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top