More on Data Form Web parts

If you use Data Form Web Parts in SharePoint at all, you must read this MSDN article by Eray Chou. This in particular caught my eye:

SPDataSource Parameters

When in List or ListItem mode, the SelectParameters collection expects a number of well known parameter names to determine the appropriate list to bind to:

  • ListID – GUID that corresponds to a List’s ListID.
  • ListName – Display name for a List.
  • ListItemId – ID for a single item in ListItem mode
  • WebUrl – Url to the web. When not specified, SPDataSource uses the current web to resolve the previous parameters. You can also use this parameter to access lists in other Web sites in the same Site Collection assuming you have permissions to that list.

That's right ladies and gentlemen, there's no need to use the site-specific ListID references in your DataView web parts. Just replace all ListID references with ListName, and you can re-use your webparts anywhere as long as the list names match.

More to come on this!