1

I'm trying to build a SharePoint app part to include in a SharePoint online page allong with other web parts.

I'm using SharePoint online developer to deploy the solution I'm developing in visual studio community 2017.

The app works in its custom link, but when I insert the app part in a page, is doesn't work, I'm getting a JavaScript error saying it can't load content from external domain... I already included allowframing tag in the master page without success, is this because I'm In the developer SharePoint or is it another problem?

Thank you

  • 1
    Can you provide some more info viz screen shot or some code parts? – DvG Jun 21 '17 at 11:01
  • Yes I can do that latter. But the code is just the initial template generated by the visual studio community 2017. – nunonaos Jun 21 '17 at 14:47
  • Hi what kind of stuff are you including into the app part? Are you using for example REST and make an ajax call to something outside the app domain? – Christian Stahl Jun 21 '17 at 21:08
  • no, I'm not doins calls to outside the app, i'm just getting the name of the logged user. – nunonaos Jun 22 '17 at 8:28
  • 1
    i was adding it in the sharepoint master page, not the app master page, because well...i was being stupid. it's solved now, thanks – nunonaos Jun 22 '17 at 9:13
1

I don't know whether this will work for you too or not, but I recently developed an SharePoint Hosted App and that App contains the Client WebPart and multiple pages.

I got the same error. I searched and I found this solution.

I was too having an App Master Page, but I included following line to each of my *.aspx page.

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

I used different different ID for every page. I haven't tried registering this on masterpage.

But registering on every page worked for me.

  • and how did you inserted that code in the aspx page? through sharepoint designer? in my case sharepoint designer just replaces that code with div because "it's unsafe content". – nunonaos Jun 22 '17 at 8:51
  • As you said you are developing the app, then surely you will have your aspx pages opened in VS right? Just add this line from VS itself and then deploy. – Aakash Maurya Jun 22 '17 at 8:54
  • 1
    ohh, i was thinking i has do add it in the sharepoint page, not the the app part page :) – nunonaos Jun 22 '17 at 8:55
  • 1
    I added it, now it shows this error: "Only Content controls are allowed directly in a content page that contains Content controls." but I guess the other issue is solved so thats a lot for that – nunonaos Jun 22 '17 at 8:58
  • 1
    yes, i places that line before <asp:content, that was the error, now it's fixed, thanks – nunonaos Jun 22 '17 at 9:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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