Domanda

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">
È stato utile?

Soluzione

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

Altri suggerimenti

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top