PageViewer WebPart and QueryString parameters

There has been dicussion (and people have noticed) about a Connected Page Viewer Webpart. There are several viable approaches to this scenario. One is to use cross-page connected webparts, but those require FrontPage interaction. There has been suggested that inheritance can be used from the PageViewerWebPart. Good luck: It's sealed.

The purpose of a Connected Page Viewer is usually to be able to instruct some page (element) to do something or feed it with params. FrontPage Dynamic Web Templates can be used if you are the developer of the page you want to view within Sharepoint. This gives you the Sharepoint look-and-feel and direct access to Querystrings. However it's less ideal for deployment because it requires FrontPage interaction.

I decided to create my own pageviewer webpart, because the thing is really just an IFrame. I wanted to be able to pass querystring parameters to it, as if it would be a normal page. I also wanted to be able to specify specifically what querystring parameters that should be passed to the QueryStringPageViewer so that sharepoint stuff wouldn't interfere. This actually works great. I can slap the QueryStringPageViewer webpart anywhere in sharepoint. Then I set the ContentLink property (either in ToolPane or dwp file) to http://server/site/page.aspx?param1&param2&param3. In this url pattern the param names are the querystring parameters that the QueryStringPageViewer should pass on to the page viewed in the webpart. Page.aspx is the webpartpage containing the QueryStringPageViewer.

So much for MS sealing their classes. Here's the code and the dwp file (thanks to manoli.net for the code formatter):

Filed under:

Comments

# TrackBack said:
Thursday, June 03, 2004 5:32 AM
# Nik said:

Thanks for the code above.

Is there a way to display the results of a post request in this web part? For example I have a web part which gives me weather info. After the user inputs the city or zip, the result is displayed in the pageviewer web part. The pageviewer web part is on a different page.

The request is a 'post' and not 'get'. SImply setting the target attribute to the pageviewer web part does not work.
Thanks

Nik

Monday, June 07, 2004 10:44 PM
# TrackBack said:

Connected Page Viewer Web Part

Tuesday, June 08, 2004 11:08 AM
# Rajashekar said:

Hi,

I want to pass the data from an .aspx page (eg:- Login.aspx) to a Share point portal webpart; which will be used to populate another webpart.


can any one give me a suggestion, in this regard.....


Thanks and Regards,
Rajashekar Putrevu

Thursday, July 29, 2004 8:00 AM
# SharePoint Thoughts » Connectable Page Viewer Web Part said:

Pingback from  SharePoint Thoughts » Connectable Page Viewer Web Part

Wednesday, October 24, 2007 11:19 PM
# SharePoint Thoughts » Connectable Page Viewer Web Part said:

Pingback from  SharePoint Thoughts » Connectable Page Viewer Web Part

Thursday, October 25, 2007 8:37 AM
# SharePoint Thoughts » Connectable Page Viewer Web Part said:

Pingback from  SharePoint Thoughts » Connectable Page Viewer Web Part

Monday, October 29, 2007 11:23 PM
# SharePoint Thoughts » Connectable Page Viewer Web Part said:

Pingback from  SharePoint Thoughts » Connectable Page Viewer Web Part

Tuesday, October 30, 2007 11:18 PM
# SharePointed » Archive » Connectable Page Viewer Web Part said:

Pingback from  SharePointed  » Archive   » Connectable Page Viewer Web Part

Wednesday, October 31, 2007 6:54 PM
# SharePointed » Archive » Connectable Page Viewer Web Part said:

Pingback from  SharePointed  » Archive   » Connectable Page Viewer Web Part

Saturday, November 03, 2007 9:12 AM
# Chayady said:

Can anybody help me to re-write this code for WSS 3.0?

I try this code, work ok except it didnot show the Link.

Chayady.sarpin@aztech.com

Wednesday, March 19, 2008 5:02 AM
# s98ssr said:

It appears in the web parts collection but does not show the ContentLink to modify.  Any ideas?

Monday, November 24, 2008 3:22 PM
# akshay said:

Hello,

I am new to sharepoint and I want to use query string page viewer in my project.Can you please guide me to create new webpart and use it in sharepoint.I need this to work. Please if anybody can help.....

Monday, April 13, 2009 3:38 AM
# Page Viewer web part with custom Query String | Gnana World said:

Pingback from  Page Viewer web part with custom Query String | Gnana World

Wednesday, April 22, 2009 10:53 AM

Leave a Comment

(required) 
(required) 
(optional)
(required)