Wednesday, May 21, 2014

Sharepoint content cannot be displayed in an IFrame


"This content cannot be displayed in IFrame.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"

You may be experiencing the above error if you are trying to open a sharepoint page/webpart page in iframe(say ModalDialog) either it could be cross domain or in same domain.

Sharepoint 2013 has added settings to control the source of iframe at site collection level under HTML Field security. This will only allow the current domain/page to accept the content from the specific domain that may be added in the iframe settings. But if you read the top error message, the source domain/page thats rendering in iframe itself is responsible for the behavior not the destination page/domain. So this setting would not resolve the issue. To get rid of the error add the below tag to masterpage/page layout/application page/visual webpart as required..

<WebPartPages:AllowFraming ID="AllowFraming1"runat="server"/>


1 comment:

  1. Receiving an error when adding the tag. Where should be located in the aspx file? Is it supposed to be enclosed in any other tags? Thanks.