How to recover broken supporting files so users are not redirected to the root of a site

Article ID: 2000861 - View products that this article applies to.
Expand all | Collapse all

Symptoms

This recovery is needed when one of the supporting files, for a list, is deleted or becomes corrupt. There might be a blank entry in supporting files, which SharePoint Designer can expose.

Cause

This generally occurs if the out of the box ListFormWebPart is removed or becomes corrupted.

Resolution

To recover the missing or corrupted ListFormWebPart do the following:

1. Create a dummy list of the same content type as the broken list. Make sure to create a new item in the list, edit the item, and view the item so that all the pages load up at least once in the browser.

2. Open an appropriate form page in the dummy list using SharePoint Designer and copy the ListFormWebPart that matches the web part.

3. Copy the code for the ListFormWebPart opening tag to the closing tag:


<WebPartPages:ListFormWebPart runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{GUID}" >

down to

</WebPartPages:ListFormWebPart>

An easy way to select from the opening to the closing <WebPartPages tags is to place your cursor before the less than sign and click Control + Shift + Semicolon.

4. Paste it into the form web part right below the following code:

<WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main"><ZoneTemplate>

5. Change the WebPartId guid so it's not a duplicate web part. I find it easiest to change one of the numbers and remember its position so you can change the value in the <ID> tag. They're the same ID just in different parts of the web part and should match.

<WebPartPages:ListFormWebPart runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{YOUR_NEW_GUID_HERE}" >

6. Look up the <ID></ID>-Tag further down in the web part code (it was about 27 lines below in my case) and change it so it the same as the WebPartId in step 5.

7. Below is a sample ListFormWebPart to help illustrate what this should look like. The sample is for a Display form.

<WebPartPages:ListFormWebPart runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{25BD9877-D161-4789-9392-F11483708BE1}" >
<WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2">
  <Title>FilterTest</Title>
  <FrameType>Default</FrameType>
  <Description />
  <IsIncluded>true</IsIncluded>
  <PartOrder>1</PartOrder>
  <FrameState>Normal</FrameState>
  <Height />
  <Width />
  <AllowRemove>true</AllowRemove>
  <AllowZoneChange>true</AllowZoneChange>
  <AllowMinimize>true</AllowMinimize>
  <AllowConnect>true</AllowConnect>
  <AllowEdit>true</AllowEdit>
  <AllowHide>true</AllowHide>
  <IsVisible>true</IsVisible>
  <DetailLink />
  <HelpLink />
  <HelpMode>Modeless</HelpMode>
  <Dir>Default</Dir>
  <PartImageSmall />
  <MissingAssembly>Cannot import this Web Part.</MissingAssembly>
  <PartImageLarge />
  <IsIncludedFilter />
  <ExportControlledProperties>true</ExportControlledProperties>
  <ConnectionID>00000000-0000-0000-0000-000000000000</ConnectionID>
  <ID>g_25bd9877_d161_4789_9392_f11483708be1</ID>
  <ListName xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">{19BB86EB-9E6E-4DFC-98C0-A87D4B731B6F}</ListName>
  <ListItemId xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">0</ListItemId>
  <ControlMode xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">Display</ControlMode>
  <TemplateName xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">ListForm</TemplateName>
  <FormType xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">4</FormType>
  <ViewFlag xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">1048576</ViewFlag>
</WebPart>
</WebPartPages:ListFormWebPart>

Take a closer look at the WebPartId and the <ID>:

WebPartId = 25BD9877-D161-4789-9392-F11483708BE1

<ID> = g_25bd9877_d161_4789_9392_f11483708be1

The differences are the g, the underscore instead of hyphen and lowercase instead of upper case. In this example change the 1 at the end to some number and make sure to change it in both locations.

Now that the <ID> tag and the WebPartId have been switched out all that is left is to change a few more properties to tailor the ListFormWebPart to the problematic list.

In the example above change the <title> attribute:

<Title>FilterTest</Title>

The ListFormWebPart was copied it was bound to a list called FilterTest. Change the Title to the current list.

The last required change we need to perform is to switch out the <ListName> attribute. The GUID that is inside the curly braces can be extracted by creating a dummy data view with SPD or by going to the list settings in a browser.

The following article has generic steps for creating a data view. Use this example and create a view based on the list that is having issues. There are other ways of getting the ID but for this example we'll do it this way.

http://office.microsoft.com/en-us/sharepointdesigner/HA100948041033.aspx

The part we care about from the test page is this:

<ParameterBinding Name="ListID" Location="None" DefaultValue="{19BB86EB-9E6E-4DFC-98C0-A87D4B731B6F}"/>

Take note of the default value in the ParameterBinding. This is the guid we want to paste in the ListFormWebPart: 19BB86EB-9E6E-4DFC-98C0-A87D4B731B6F

<ListName xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">{19BB86EB-9E6E-4DFC-98C0-A87D4B731B6F}</ListName>

The final result should be a functioning ListFormWebPart. Once the page is saved the ListFormWebPart might generate an error in SPD. That is fine, click F12 to preview the page in a browser and make sure the web part renders.

There might be a need to go into the supporting files and change the settings to use the new form page. To do this, perform the following steps:

1. Expand the lists folder and right click on the list in question.
2. Go to properties
3. Go to the Supporting Files tab.
4. Pick the appropriate content type and select the correct form page. Do not set it for the folder type as it will do nothing. After each save perform a control + shift + F5 to force a hard refresh on your folder list to make sure the settings stuck. 

In addition to make sure the folder settings stayed check the functionality in the browser to see if it functions correctly.

Note:

Depending on the customization needs the out of the box form pages, such as DispForm.aspx, should always have the ListFormWebParts closed and hidden but never deleted from the page. These are the properties that can be changed via WebPart properties dialog or in Code View:

<IsVisible>true</IsVisible>
<IsIncluded>true</IsIncluded>

Both of those can be set to false. Use lowercase to keep everything as close to out of box as possible. Generally, avoid hiding and closing the ListFormWebPart until the supporting files have been fixed.

Note:

In order for supporting files to function correctly in Windows SharePoint Services 3.0 or Microsoft Office SharePoint Server 2007 the ListFormWebPart needs to be present.

In SharePoint Foundation, and any product built on top of it, this restriction has been lifted and the DataFormWebPart can stand on its own as a proper form page WebPart.

Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Properties

Article ID: 2000861 - Last Review: September 20, 2011 - Revision: 9.0
APPLIES TO
  • Microsoft Office SharePoint Designer 2007
  • Microsoft Office SharePoint Designer 2007 Service Pack 1
  • Microsoft Office SharePoint Designer 2007 Service Pack 2
  • Microsoft Office SharePoint Server
  • Microsoft Office SharePoint Server 2007
  • Microsoft Windows SharePoint Services 3.0
  • Microsoft Windows SharePoint Services 3.0 Service Pack 1
  • Microsoft Windows SharePoint Services 3.0 Service Pack 2
Keywords: 
KB2000861

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com