Adding Code to SharePoint pages using the Page Viewer Webpart

As I have mentioned before, my team and I are working on redesigning our corporate intranet in SharePoint. Our programmers are learning .Net and have been getting comfortable coding in it and creating applications. They haven’t really taken the time to figure out how to code within SharePoint though, and this leaves us with a problem. There was a lot of custom code on our old intranet and SharePoint doesn’t have an out-of-the-box solution for everything. My programmer started looking into creating a custom webpart but decided it was a pain and due to time constraints, we came up with an easy solution that works quite well.

He created a .net page with the necessary code for the widget and we pulled the code into the Sharepoint page using the Page Viewer webpart. We currently have two of these on our home page. One randomly loads a different slideshow image that upon clicking the image launches a slideshow in a popup window. The other loads stock quote data that is pulled from a web service.

I’m sure that hard-core programmers and SharePoint developers will weep at this hack, but for a small team with limited resources and time, this works quite well for us and was way easier to implement than a custom webpart. I have also used the page viewer webpart to pull in a Google map. On our old intanet, I was able to add the iframe code that Google Maps generates, but SharePoint seems to hate iframes and wont render them, so the page viewer webpart was a decent workaround here as well.

Advertisements

5 thoughts on “Adding Code to SharePoint pages using the Page Viewer Webpart

  1. I don’t know, that seems quite a reasonable solution.

    We have a sister company who produce a package for doing statistical process control – i.e. LOTS of graphs of how things are performing. It’s written in Java, and we wanted to ‘integrate’ this with SharePoint. We could’ve ended up with massive rewrites, but actually showing it through the Page Viewer web part gave a pretty good result in about 5 minutes.

    Why spend weeks reinventing the wheel?

    • I’ll ask the programmer on Monday. I know for the slideshow, all the code is .net, resides on another server, and the javascript to open a new window is all included on the .apsx page we are pulling in.

      • Talked to the programmer, he said: the image is wrapped in a hyperlink that calls a javascript function that creates a new window object

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s