locked
IFrame/Frameset in SharePoint 2010 Content Editor Web Part RRS feed

  • Question

  • When putting a Frameset or IFrame object within CEWP for SharePoint 2010, it results in Open/Save dialog box for the reference files inside the tag. I want to display two files on the web page using the Frameset or IFrame as I get that as part of the extract from other system. 
    Tuesday, February 14, 2012 12:34 PM

Answers

  • Interestingly renaming the file as .aspx did the trick! Looks like HTMLs are blocked to be opened via browser!
    • Marked as answer by Shalin Parmar Monday, February 20, 2012 8:58 AM
    Monday, February 20, 2012 8:58 AM

All replies

  • Just did it and it works without problems. Did you do it by editing the HTML directly like explained in http://social.technet.microsoft.com/wiki/contents/articles/4988.how-to-add-html-content-into-the-content-editor-webpart-in-sharepoint-2010.aspx or did you use the content link (I'm guessing the latter). Here's my code:

    <p>&#160;</p>
    <p>&#160;test<strong>test</strong></p>
    <p>&#160;</p>
    <iframe src="/testdox"></iframe>


    Kind regards,
    Margriet Bruggeman

    Lois & Clark IT Services
    web site: http://www.loisandclark.eu
    blog: http://www.sharepointdragons.com

    Wednesday, February 15, 2012 6:40 AM
  • I tried both ways...resulting in same way....asking for Open/Save dialog box for both scenarios rathar then opening the file!
    Wednesday, February 15, 2012 7:10 AM
  • I see a very strange behaviour...even if I put any HTML page without frames, SP 2010 Content Editor Web Part & Page Viewer Web Part still shows Open/Save Dialog box...when I link it!

    Can some one please shed some light on this?

    Thursday, February 16, 2012 12:06 PM
  • Hi Shalin,

                  which type of format you are trying to display in iFrame,take an example Upload two txt files in doc library and take there path and insert it in CEWP Html iFrame it should work for you,if you are trying to open Doc,excel ot ppt file then Server should have installed Client software installed which contains all Office Client(its like google Docs) with the help of which we can see file if its not installed it might ask you for same which is asking you right now

    Hope i am making Sence to you topice nad understood you problem correctly.


    Abhijeet S. Thorat

    Thursday, February 16, 2012 12:26 PM
  • The link that Margriet has posted should work fine.
    Are you linking to an HTML File in the content link field within the CEWP Editor??

    Try this:

    • Add a content editor web part on to your page
    • Edit the web part
    • on the content editor web part, click the area that says "Click here to add new content"
    • Click the ribbon bar should button "HTML" and select "Edit HTML"

    Paste in the example code that Margriet provided:

    <p>&#160;</p>
    <p>&#160;test<strong>test</strong></p>
    <p>&#160;</p>
    <iframe src=http://google.com></iframe>
    and submit - This should work fine.

    Drummer.. Oh and SharePoint Developer & Consultant http://spdrummerboy.blogspot.com

    Thursday, February 16, 2012 12:33 PM
  • Ok. Let me explain the whole scneario to clarify:

    I have .html files as an extract from Provision model which uses frames. I need to incorporate that into my SharePoint web page to render on it. Here are the steps I am following

    • Create a new wiki page
    • Add a Content Editor Web Part and put content link to .html file => RESULT: Open/Save dialog box for the referenced .HTML file
    • Add a Page Viewer Web Part and put file link to .html file => RESULT: Open/Save dialog box for the referenced .html file
    • Add a Content Editor Web Part and put html code from the source file => RESULT: Open/Save dialog box for files referenced by frames!!!

    I hope that clears any confusion about my issue.

    - Shalin

    Thursday, February 16, 2012 2:24 PM
  • hi,

       when you add web part and edit webpart you see Click her to add Contents,click on that and in Ribbon you will see Editing tools in which

       Format Text go to html click on it and place you html code over there or insert this code over there

       ​ <table width="100%" cellspacing="0" >

            <tbody>

                <tr>

                     <td >​ <iframe src="http://www.google.com"></iframe></td> you can use you html url over here
                     <td >​ <iframe src="http://www.google.com"></iframe></td>

                </tr>

            </tbody>

         </table>

    hope this helps you out


    Abhijeet S. Thorat / Please don't forget to make as Answer if you find my comment useful and as Answer for your question

    Thursday, February 16, 2012 2:42 PM
  • Still the same issue.....here is the code:

    <table width="100%" cellspacing="0" >

            <tbody>

                <tr>

                     <td >​ <iframe src="file1.html"></iframe></td>
                     <td >​ <iframe src="file2.html"></iframe></td>

                </tr>

            </tbody>

         </table>

    It asks me to Open/Save/Cancel the file1.html!!!

    Thursday, February 16, 2012 3:36 PM
  • Interestingly renaming the file as .aspx did the trick! Looks like HTMLs are blocked to be opened via browser!
    • Marked as answer by Shalin Parmar Monday, February 20, 2012 8:58 AM
    Monday, February 20, 2012 8:58 AM
  • Hey hi,

              sorry for late reply but you can use Html,i did one minor change in Central administration.

              got to Central admin-> over there under Application Managment -> Click Manager Web Application -> click you web application -> in Ribbon click on General Settings -> over there you will Find one Setting call Browser File Handling -> by default it will be Strict from strict you can Chnage to permissive after that you can see that you can use Html file Directly inside you Iframe and other Html webpart


    Abhijeet S. Thorat / Please don't forget to make as Answer if you find my comment useful and as Answer for your question

    Monday, February 20, 2012 9:11 AM