2

In SharePoint 2007, there are several relatively unknown DataSourceModes you can use with DVWPs (CrossList, ListOfLists, ListItem, and Webs - see http://msdn.microsoft.com/en-us/library/ie/microsoft.sharepoint.webcontrols.spdatasourcemode.aspx). I'm trying to use the Webs value in a DVWP in SharePoint 2010 and I can't seem to get it to work.

I've gone through exactly the same steps in SharePoint Designer in 2007 and 2010:

  • Add a DVWP to the page
  • Choose the Announcements list as the DataSource (just to get something up and running)
  • Display the ID column in a Multiple Item View
  • Switch the DataSouceMode to Webs (DataSourceMode="List" -> DataSourceMode="Webs")

This works in 2007, but gives me an error in 2010. Has anyone seen this work successfully in 2010?

6
  • How does the markup compare between the 2007 and 2010 versions?
    – James Love
    Jan 30, 2012 at 16:15
  • Also, what error?
    – James Love
    Jan 30, 2012 at 16:17
  • The error occurs in SPD right after I switch the DatasourceMode to Webs, so there's no markup to look at; I don't get that far. The error is the ever-helpful: "The server returned a non-specific error when trying to get data from the data source. Check the format and content of your query and try again. If the problem persists, contact the server administrator." Jan 30, 2012 at 17:00
  • I stripped the DataSource down to just: <DataSources><SharePoint:SPDataSource runat="server" DataSourceMode="Webs" UseInternalName="true" UseServerDataFormat="true" id="dataformwebpart1"> </SharePoint:SPDataSource></DataSources> and still no joy. There's got to be something I'm missing. Jan 30, 2012 at 19:42
  • Did you already try with different SelectParameters inside SPDataSource? Tried Reflector?
    – Jussi Palo
    Jan 30, 2012 at 21:42

1 Answer 1

1

Mark - just spotted your question while I was drafting this blog post and searching for a solution to this problem. It seems there is a bug with the Webs mode in 2010 because the SPWeb no longer has a CustomizationMode property and the data source expects it....

1
  • Thanks for the info, Peter. Great work on the Metro DVWP, too! Mar 23, 2012 at 20:52

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.