How to prevent Supporting Files from being incorrectly set to erroneous page
Symptoms:
After replacing normal list form (ListFormWebPart) with custom list form (DataFormWebPart) on any of the supporting files (New, Edit, Display) for a SharePoint list, the list view properties do not work as expected. Hyperlinks for corresponding supporting file will point to erroneous or incorrect location.
Example: replacing normal list form with a custom list form on supporting file DispForm.aspx results in "display" hyperlinks going to an erroneous page, such as a different, un-intended supporting file.
This is incredibly frustrating, right? Here is a sure-fire to prevent this from occurring.
Prevention:
- Open SharePoint Designer 2007. Go to File | Open Site and connect to SharePoint site.
- Expand out Lists -> [List Name] -> open DispForm.aspx .
- Highlight normal list form by clicking on it. This will select the entire web
part. - Right-click on selected web part, and choose Web Part Properties…
- Expand [+] Layout, check option for Hidden, click OK.
- With web part still highlighted, hit the right-arrow key once. Hit Enter. This creates some whitespace to insert.
- Go to Insert | SharePoint Controls | Custom List Form…
- Select appropriate list or library, content type, and type of form to create. Click OK.
- Save page.
NOTE: The steps above are how to prevent supporting files from being incorrectly set to erroneous page, not how to fix a pre-existing problem. That's quite a bit more tricky.
Keeping the normal list form on the page should ensure the supporting files stay intact. Think of this as a sort of “best practice” and you should never run into the problem again.
Additional Information:
KB 935504 - Error message when you click "New" to create a new item in a list or when you click an existing item in SharePoint Server 2007 or in Windows SharePoint Services 3.0: "Invalid page URL" or "An unexpected error has occurred"