none
display Sharepoint page in iframe RRS feed

  • Question

  • I try to display the webmap (index.aspx with subfolders) stored on Sharepoint and no luck.
    I'm using the Embed webpart on the Communicationsite of Sharepoint Online and use the next iframe:

    <iframe src="https://******.sharepoint.com/SiteAssets/Webmap/index.aspx#11/52.1/5.62" width="100%" height="470"></iframe>

    I have uploaded the map Webmap with its content on SiteAssets. Webmap consists, besides index.aspx, of the following subdirectories: css, data, images, js, legend, markers, webfonts.

    The error message of the webpart is
    Something went wrong
    Cannot find file
    TECHNICAL DETAILS
    Solve problems with Microsoft Sharepoint Foundation

    (The message is translated by me in English so maybe it is slightly different ie Cannot find file)
    When I store the Webmap data on my local PC and rename index.aspx to index.html the page is displaying good.
    The trouble is that it has worked on an other site which I had to move. I don't know the difference, I checked permissions, I'm lost.

    Any help please

    Wednesday, November 20, 2019 8:36 PM

All replies

  • Hi JanHGL,

    I created a simple aspx file using Visual Studio like below:

    <%@ Page Language="C#" %>
    
    <!DOCTYPE html>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                TestIframe
            </div>
        </form>
    </body>
    </html>
    

    Upload to the root SharePoint Online Site Collection Site Assets library -> webmap sub folder and embed the iframe like below in another communication site:

    It's working to display content in the page:

    In the testing, I also append "#11/52.1/5/62"behind file extension aspx, it won't lead to the error.

    In this case, I would suggest you could still to check the file path to see if it's valid.

    And please also check out the permission if the page file is in a different site collection, make sure the sub folder "Webmap" has permission to everyone in Tenant.

    Thanks

    Best Regards


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

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Thursday, November 21, 2019 9:30 AM
  • Hi Jerry,

    Thanks.

    If I look to your aspx file I think the problem could have to do with running on the server.
    My index.aspx file is created by generating with a tool a index.html file and I have renamed the index.html file to index.aspx. So in my index.aspx file there is no runat="server".

    I have edited the index.aspx file:

    <head> edited to <head runat="server">
    within <body> I have added <form id="form1"runat="server"> and </form>

    I think the filepath is oke, when I leave out the /index.aspx part in src then it shows the webmap directory.

    It does not solve the problem, can I show you the aspx file?

    Best regards

    Friday, November 22, 2019 7:31 AM
  • Hi JanHGL,

    Based on your description, the index.aspx is renamed from html file. 

    So I think the issue mainly because of the file content itself. A suggestion is to create a empty aspx file like "Wiki Page" and then add the html snippet under PlaceHolderMain tag in the aspx, then do a test with iframe to see if it works.

    Thanks

    Best Regards


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

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.


    Friday, November 22, 2019 7:59 AM
  • Hi Jerry,

    You noticed I think that I'm not a developer.
    Would you please explain with some more details what I must do.
    I don't know what you mean with "create a empty aspx file like "Wiki Page" and then add the html snippet under PlaceHolderMain tag in the aspx".

    I can past my current index.html file, do you want to look it?

    Thanks, 

    Jan

    Friday, November 22, 2019 10:08 AM
  • Hi Jerry,

    I tried your simple index.aspx file and I get the same error. So probably it is not caused by the content of the index.aspx file. So what can it be then?

    Give this any new informatie the search for the error?

    Regards,

    jan

    Friday, November 22, 2019 1:20 PM
  • Hi Jerry,

    In addition:

    When I change the filename in iframe src= statement, like index.as, then I get 404 NOT FOUND. If I use the right filename index.aspx then I get the original error Something went wrong etc. It seams to be Sharepoint don't like .aspx files. Is there a configuration to allow aspx?

    Regards,

    Jan

    Friday, November 22, 2019 1:42 PM
  • Hi JanHGL,

    I think the mainly issue in your side is you don't use the correct aspx file format which supported in SharePoint.

    Here is a solution to add the Html/JavaScript in the SharePoint aspx page:

    In the Site Pages library, create a wiki page and then add a Script Editor Web Part in the page, add the html/JavaScript code snippet needed in this web part, please refer the steps in the video below:

    Script Editor Web Part in SharePoint

    Then test this site page in iframe to see if it works.

    Thanks

    Best Regards


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

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Monday, November 25, 2019 8:58 AM