Jun
23
Two Helpful Web Parts for FREE!!!
Filed Under Development, SharePoint
Since the response was so great to our articles regarding using the QueryString to pass information to PageViewer web parts, I have decided to make both web parts available, as SharePoint features deployed at the Site Collection level.
You can download the web parts at my company web site: www.theportalgroup.biz
Just click on “Downloads”, register for free, and they are all yours.
UPDATE: Registration is no longer required…and in an unrelated note, special thanks to the over 200 new registered users with a username of “asdf”…I really appreciate it. <grin />
In case you have not read the blog posts yet (and don’t want to), here is the basic overview:
- QueryString Pass-Thru Web Part. The first web part will pass through the entire QueryString from the parent Web Part Page, append it to a Base URL, which the user can configure in the tool pane, and display the contents at the concatenated URL in the PageViewer web part. This is especially useful when you want to link to display content from several external pages that are all part of the same site, with a URL format that looks something like this: http://intranet.company.net/Default.aspx?pageid=420. If you wanted to display the contents of 40 different pages in SharePoint using the standard PageViewer web part, you would need 40 separate web part pages, each hard-wired to the target URL. Using the QueryString Pass-Thru Web Part, you can just set up one Web Part Page, and pass it a QueryString parameter with the pageid every time you want to use that page.
- QueryString Parameter Pass-Thru Web Part. This web part will pass through a QueryString parameter called ‘Url’ (‘url’ and ‘URL’ will work as well), which contains a properly formatted URL, to a PageViewer web part that will display the contents at that URL. This is useful for a situation where you want to display content from several different external pages that are specific and separate pages, not just differentiated by the QueryString (e.g. http://intranet.company.net/hr/Deafult.aspx, http://intranet.company.net/finance/Default.aspx, etc.) The benefits are the same as the QueryString Pass-Thru Web Part…you only need one web part page that you can use to connect out to any page, vice needing a separate web part page for every connection, if you were using the standard PageViewer web part.
There are a few caveats to keep in mind as well.
- QueryString Pass-Thru Web Part. You cannot use a QueryString parameter named ‘id’. SharePoint will think it needs to look for an ID of its own with that value, and you will get an error on the page.
- QueryString Paramter Pass-Thru Web Part. Be careful of the characters you are using in your ‘Url’ parameter. It is a good idea to use the HTML character escape sequences. For instance, if you want to pass a URL that has a query string, you will need to use the escape sequence for the question mark and ampersand(s) or else the code with think the ‘Url’ parameter has ended before you wanted it to end.
Hope you enjoy the web parts, and please feel free to let us know what you think.
Oh – one more thing. If you are interested in expanding on these or otherwise developing them yourself, you can get to the blog posts at the links below. The first one even has a Screencast that might help those without a lot of SharePoint development experience.
Passing Through the Entire Query String
Passing Through a Single Parameter in the Query String


Coooooooooooool
Big thanks for this Webpart. Awesome !