Close The Modal Dialog Of A Provider-Hosted App

Highlighted
New Contributor

I have a provider hosted app which creating a custom ECB and Ribbon action on lists in SPO which opens popup using the code 

newcustomaAction.Url = "javascript:OpenPopUpPageWithTitle('" + Actionurl + "', RefreshOnDialogClose, 600, 400,'Publish')"; 

Now i want to close the popup using button click on the opened popup(Aspx form). I tried msdn link  How To Close The Modal Dialog Of A Provider-Hosted App but not able to find the solutions.

function closeParentDialog(refresh) {
    var target = parent.postMessage ? parent : (parent.document.postMessage ? parent.document : undefined);
    if (refresh)
        target.postMessage(‘CloseCustomActionDialogRefresh’, ‘*’);
    else
        target.postMessage(‘CloseCustomActionDialogNoRefresh’, ‘*’);
}



closepopup.PNG

 

 

 

0 Replies