2

I have developed a SharePoint-Hosted app which opens a new modal dialog in a list. On SharePoint Online it works without problems, but if I deploy the app on a SharePoint 2013 On-Premise system I get this error when I open the modal dialog:

This content cannot be displayed in a frame Erro

I have this code added to my .aspx-file:

<WebPartPages:AllowFraming runat="server" />

But it does not work.

Here is my CustomAction from Elements.xml:

<CustomAction Id="2c2b7036-4582-4238-8205-b348628c0ed9.OpenMediaDatabase"
    RegistrationType="List"
    RegistrationId="100"
    Location="CommandUI.Ribbon"
    Sequence="10001"
    HostWebDialog="true"
    HostWebDialogHeight="900"
    HostWebDialogWidth="800"
    Title="Custom Title">

2 Answers 2

2

Did you add in Elements.xml inside CustomAction this?

HostWebDialog="TRUE"
HostWebDialogWidth="500"
HostWebDialogHeight="500"

EDIT

If you are using Cross Site Publishing try adding <WebPartPages:AllowFraming runat="server"/> inside master page like in this link

3
  • Yes, I edited my question and added the code from Elements.xml Commented Apr 30, 2015 at 8:52
  • I edited my answer. Might this will help.:)
    – Marko Tica
    Commented Apr 30, 2015 at 9:12
  • Thank you, if I add the code to master page it works! :) Commented Apr 30, 2015 at 10:14
0

I added the <WebPartPages:AllowFraming runat="server"/> inside the ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" in Default.aspx page and the issue got resolved

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.