Listview Webpart required on DispForm.aspx page for document library

Symptoms

In MOSS 2007

For a document library in a MOSS2007 site when clicking on the View Properties of a document, you are redirected to the root site of the site collection. Also if versioning is enabled, when clicking on Version History, an Unknown Error appears.

In SharePoint 2010

For a document library in a SharePoint 2010 site when clicking on the View Properties of a document, you get following error:

Unable to find the default display form for list Shared Documents.
Troubleshoot issues with Microsoft SharePoint Foundation.
Correlation ID: cb92cec1-eabf-4ec4-8a02-f7b0164b8528
Date and Time: mm/dd/yyyy hh:mm:ss AM

Cause

In MOSS 2007

When removing the OOB ListView Web Part from the DispForm.aspx page of a document library this behavior is expected.

All three pages, AllItems.aspx, EditItems.aspx and the DispForm.aspx have the same webpart and the appropriate links are built by the webpart itself controlled by server variables. If the pagetype is null, it will not generate the correct url.

In SharePoint 2010

When removing the OOB List Form Web Part from the DispForm.aspx page of a document library this behavior is expected.

All three pages, AllItems.aspx, EditItems.aspx and the DispForm.aspx have the same webpart and the appropriate links are built by the webpart itself controlled by server variables. If the pagetype is null, it will not generate the correct url.

 

Resolution

If the web part has been removed, willingly or not, the solution is to add it back by using a clean DispForm.aspx page as an example.

In SharePoint Designer 2007 for MOSS 2007 and SharePoint Designer 2010 for SharePoint 2010

Copy code of DispForm.aspx page from a working document library.
Paste all the code into the corrupted one.
Go to the afflicted document library settings and in the URL we can see the list ID.
Modify the code contents of the DispForm.aspx with the appropriate list ID and problem is solved.

Microsoft Internal Support Information

1. Create a document library
2. In SharePoint Designer open the DispForm.aspx page and delete the ListView webpart for MOSS 2007 and List Form webpart for SharePoint 2010.
3. Go back to the document library and add a document. Click on view properties and the page will be redirected to the root site collection.

Product Bug Number: OfficeOFE 19198
Author ID (email alias): carinan
Writer ID(email alias):
Tech Review ID (email alias): frede
Confirm Article has been Tech Reviewed: Yes
Confirm Article released for Publishing: Yes
Properties

Article ID: 2000858 - Last Review: Apr 16, 2010 - Revision: 1

Feedback