Monday, April 30, 2012

SharePoint Page IFRAME Inside a SharePoint Page

I recently had a client that wanted the full functionality of a pre-built solution already deployed and used in another web farm yet under the same domain authentication scheme.   We vetted two approaches, one was something customized using web services.  The other approach was loading the needed content into an IFRAME on this client’s SharePoint site.  The IFRAME solution seemed so much easier at the time, so we went with that one.

OOTB SharePoint comes with a web part called the Page Viewer Web Part, which, if you explore the markup created, just places an IFRAME tag inside the messy web part markup.   Also, no properties to this IFRAME tag can be manipulated, such as the ID or NAME or style.  While I know anything can be accomplished through JavaScript, jQuery and DOM parsing, I wanted an IFRAME tag control, plain and simple, so I used a Content Editor Web Part (CEWP).