If you’ve ever played around with any of the SharePoint list forms (NewForm.aspx, EditForm.aspx, or DispForm.aspx) in SharePoint Designer, then you may (probably) have been faced with broken links and a host of other errors that have rendered your forms, and quite probably your list, useless.
I faced a similar quandry late last week. A form that I had done some work on broke and my backup plan of deleting the broken form and copy/pasting the original form back also failed. Come to find out that rather than looking for file names like every other webserver in existence, SharePoint works on a GUID system. I’m not 100% on how it works exactly, but I know that it does.
So faced with the prospect of having to migrate the list data (LOTS of it) to a new list in order to fix the broken form, I decided that it would be a much better path to learn how to fix the GUIDs.
The Challenge – Fix broken forms on a SharePoint list.
The Problem – SharePoint operates on a GUID system rather than a file name system so simply replacing the broken file with a backup file won’t work since SharePoint will look for a file with the proper GUID, not just the proper file name.
The Solution – Luckily there’s an easy way to fix this, but it takes a bit of digging. I’m going to assume that you’re already a bit familiar with SharePoint designer and the file structure of a list since (to my knowledge) the only way to break a form is from within Designer. Here are the things you’ll need to fix your forms:
*** NewForm.aspx *** <WebPartPages:ListFormWebPart runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{[Form GUID]}" > <Title>TITLE HERE</Title> <ID>g_[Form GUID]</ID> <ListName xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">{[LIST GUID]}</ListName> <ControlMode xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">New</ControlMode> <FormType xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">8</FormType> </WebPartPages:ListFormWebPart> *** EditForm.aspx *** <WebPartPages:ListFormWebPart runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{[Form GUID]}" > <Title>TITLE HERE</Title> <ID>g_[Form GUID]</ID> <ListName xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">{[LIST GUID]}</ListName> <ControlMode xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">Edit</ControlMode> <FormType xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">6</FormType> </WebPartPages:ListFormWebPart> *** DispForm.aspx *** <WebPartPages:ListFormWebPart runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{[Form GUID]}" > <Title>TITLE HERE</Title> <ID>g_[Form GUID]</ID> <ListName xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">{[LIST GUID]}</ListName> <ControlMode xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">Display</ControlMode> <FormType xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">4</FormType> </WebPartPages:ListFormWebPart>
NewForm.aspx | ControlMode = New FormType = 8 |
EditForm.aspx | ControlMode = Edit FormType = 6 |
DispForm.aspx | ControlMode = Display FormType = 4 |
Now that you have all the tools to make this thing work, here’s how you do it:
Source : http://moblog.bradleyit.com/2008/10/broken-sharepoint-list-forms.html