I was working with an aspx page in SharePoint Designer and wanted to copy a Data View Web Part (DVWP) and use it again on the same page with different parameters. (Same data source, just different filtering.) Every time I did so, everything rendered just fine in Designer, but when I went to save the file, I got the following error:
Server error: The URL ‘filename’ is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web.
Certainly not much to go on. After a bit of fiddling, I realized the the problem was that I had introduced a duplicate Web Part ID by simply doing a copy of the code. The solution was to insert a new DVWP, add a data source and a column to instantiate it, and then replace the inner code (i. e., everything except the first and last lines) with the code from my original Web Part.