1

I have multiple DataView Web Parts that are getting items from a list in SharePoint 2010. The web parts are in a subweb and the data from the list is in the root web. I can get this web part to work just fine by specifying the ID of the list:

<dsp:dsQuery select="/list[@id='GUID GOES HERE']" resultContent="Both" resultRoot="Rows" resultRow="Row" columnMapping="Attribute">

However! I cannot use this method of selecting the list by the ID because I will be using export-spweb/import-spweb and moving the subwebs to a different location (this command re-assigns IDs... so after the export/import my web parts break). What I want to do is select the list by something more definite... like below (which does not work):

<dsp:dsQuery select="/list[@name='LIST NAME GOES HERE']" resultContent="Both" resultRoot="Rows" resultRow="Row" columnMapping="Attribute">

To summarize, I need my dataview web parts to use a dsQuery that goes by list name and not ID. Has anyone done this before or am I stuck with editing hundreds of web parts' IDs? That would be awful =)

Any help is appreciated!

Cactuar167
  • 45
  • 5

1 Answers1

0

You can do that by changing List GUIDs to List name. Here is an example: http://salaudeen.blogspot.com/2012/02/how-to-make-dataview-portable.html

Mark
  • 1
  • 1
    We usually delete link-only answers. Can you please add enough of an example here so that it answers the question wholely? –  Apr 17 '12 at 23:53