如何在iframe代码中查看具有不同域的SharePoint页面

时间:2019-05-27 21:43:00

标签: javascript sharepoint sharepoint-2013 sharepoint-online sharepoint-designer

如何在iframe html代码中查看位于不同域的SharePoint页面。限制是由于客户端安全原因,我不能让服务器访问web.config文件或iis等进行更改。因此,我必须在站点或母版页上进行操作。

尝试通过编写以下代码在Pagelevel和Site MasterPage上禁用X-frame选项相同的来源

<WebPartPages:AllowFraming runat="server"/> 
or
<%@ Register Tagprefix="WebPartPages" 
Namespace="Microsoft.SharePoint.WebPartPages" 
Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, 
PublicKeyToken=71e9bce111e9429c" %>
<WebPartPages:AllowFraming runat="server"/>
or
<SharePoint:PageTitle runat="server">
<asp:ContentPlaceHolder ID="PlaceHolderPageTitle" runat="server">
<WebPartPages:AllowFraming runat="server" /> 
<SharePoint:ProjectProperty Property="Title" runat="server" />
</asp:ContentPlaceHolder>
</SharePoint:PageTitle>

预期结果是它应该在iframe中显示SharePoint文件或页面,而不是抛出错误,提示某些域例如:https://portal.connect.com拒绝连接。

0 个答案:

没有答案