locked
Custom Ribbon open dialog is not working. Error : This content cannot be displayed in a frame. RRS feed

  • Question

  • Hi,

    I have implemented a SharePoint Add-in and deployed to SP 2016 and SP Online.

    This Add-in project is to add a new custom ribbon for the document library. Upon click on the custom ribbon button, it will open a dialog and show document library property bag information.

    This Add-in is working fine on SP 2016 with no error but not for SP Online. For SP Online, upon click on the custom ribbon button, dialog shows up with error message: This content cannot be displayed in a frame. The content is loaded successfully if open in a new window.

    I need open the content in dialog badly for SP Online.

    Hope someone expert here can give me advice.

    Thanks,

    John


    • Edited by JohnThen Tuesday, August 8, 2017 6:06 AM
    Tuesday, August 8, 2017 6:03 AM

Answers

  • Hi, All,

    After keep trying and trying, finally I am able to show the page in iframe pop-up.

    Here is the solution:

    1. add <meta http-equiv="X-Frame-Options" content="allow" /> within <head> tag.

    2. add <WebPartPages:AllowFraming runat="server" /> within <body> tag.

    BAM! Page finally able to display as a pop-up. 

    • Marked as answer by JohnThen Thursday, September 28, 2017 3:35 AM
    Thursday, September 28, 2017 3:34 AM

All replies

  • Hi,

    I tested below project in my online environment, it works.

    You may reference the project and update your solution.


    https://github.com/OfficeDev/SharePoint-Add-in-Localization

     

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Proposed as answer by Dennis Guo Monday, August 14, 2017 10:07 AM
    Wednesday, August 9, 2017 7:42 AM
  • Hi, All,

    After keep trying and trying, finally I am able to show the page in iframe pop-up.

    Here is the solution:

    1. add <meta http-equiv="X-Frame-Options" content="allow" /> within <head> tag.

    2. add <WebPartPages:AllowFraming runat="server" /> within <body> tag.

    BAM! Page finally able to display as a pop-up. 

    • Marked as answer by JohnThen Thursday, September 28, 2017 3:35 AM
    Thursday, September 28, 2017 3:34 AM