- Before exporting the data view webpart add an additional parameter using SharePoint designer parameter ribbon option, the final code for the parameter should look like the following: <WebPartPages:DataFormParameter Name="WebURL" ParameterKey="WebURL" PropertyName="ParameterValues" DefaultValue="/sites/toplvlsite/"/>
- Once a dataview webpart is created using SharePoint designer, perform an export using [WEB PART]\To File.
- Open the exported webpart file content in NotePad++
- Search for a line <property name="ListName" type="string" and remove it. E.G:
<property name="ListName" type="string">{2AA6099D-238B-4692-8BB4-48EFFB0952B1}</property> - Remove the following elements and their content out of the file as we are only using the dataview to display content:
- Before doing the next step, replace the GUID assigned to the ListID parameter with ListName value (Get from List Settings > Name value) – Look for GUID with parenthesis as well { and }.
- Replace all occurrence of "ListID" to "ListName" and replace the defaultValue with the Name of the list.
- The following entry needs to be adjusted as well for string entry : <property name="ListName" type="System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">Issues</property>
<UpdateParameters>[Any Content]</UpdateParameters> <InsertParameters>[Any Content]</InsertParameters> <DeleteParameters>[Any Content]</DeleteParameters>