I have a requirement to create a DVWP which queries a list of items: 1.1, 1.2, 1.3 etc. I have a webpart that takes an input (i.e. "1.1") and does some cool stuff with it.

What I would like to do is to iterate through my list in the DVWP and place my webparts on the page, passing in the DVWP values ( 1.1, 1.2, 1.3 ) so the webpart can do its cool stuff.

This must all be done "no-code" as we don't have permissions to write server-side code.

The algorithm would look something like this:

  1. Query list for values
  2. for each value (X)
  3. insert WebPart A on page with (X) as a parameter
  4. insert WebPart B on page with (X) as a parameter
  5. next (X)

Data View Web Parts are very good at filtering data from lists and translating the XML to client side code like HTML or Javascript. However, I don't think a web part is a good target output, because that is normally processed on the server side. Instead, I would look at connecting the DVWP to the other web parts on the page and providing the values from the one to the ohters.


  • After pondering more, I realized that the main sticking point here is that there are a variable number of weparts that will be on the page. This is why I was using a DVWP and using the foreach. Is there another way to add a variable number of webparts to a page at runtime? – Lvl15TechNinja Apr 30 '13 at 21:19
  • Not that I can think of off the top of my head. What kind of web part is it? Can it be done another way? – Tom Resing May 2 '13 at 16:18

I think I have found a solution. I made a page that takes the sub-element as a query-string parameter. It then renders the web-parts that it needs. Then in the main page, in the XSLT, for each row I use an iframe while passing the sub-element as a query-string. I call the su-element page in the iframe.

So I am not trying to use webparts in the XSLT, but I AM using iframes, and it works like a charm.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.