HI
i am trying to use SP.UI.ModalDialog in SharePoint hosted app. Modal dialogue will open the attach file window of host site list item. it works fine with if you are trying to open app web site list content, But it will through an error, if you are trying to open host web list url,
Error:
This content cannot be displayed in a frame:
To help protect the security of information you enter into this website, the publisher of this content does not allow it to be displayed in a frame. |
code:
var uploadUrl="http://hostsite/sites/sitename/_layouts/15/AttachFile.aspx?ListId=" + listGuid + "&ItemID=" + itemId;
var opt = {
width: 600,
height: 150,
url: uploadUrl,
title: "Attach File",
dialogReturnValueCallback: updateAttachmentList
};
SP.UI.ModalDialog.showModalDialog(opt);