Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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)
share|improve this question

2 Answers 2

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.

Reference

share|improve this answer
    
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
up vote 0 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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