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):

5 Comments

  • 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

  • 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

  • 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

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

  • 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.....

Comments have been disabled for this content.