If you try to edit the any of the sharepoint forms (NewForm.aspx, EditForm.aspx, DispForm.aspx) in SharePoint designer, then you may face the problem of broken links.
For example if a link to an item in a list should point to http://servername/sites/sitename/Lists/listname/DispForm.aspx?ID=2 but the item will take you to http://servername/ID=2.
The reason is SharePoint operates on a GUID system rather than a file 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. Follow these simple steps.
1) Open the broken form and also another form in the same site which is working properly in the SharePoint designer.
2) Find the <WebPartPages:ListFormWebPart … to </WebPartPages:ListFormWebPart> in the broken form.
3) Replace that code from the form which is working fine.
4) The below code shows the lines that you have to change in the copied code.
<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>
5) Create a new GUID or copy a GUID from some other form in the site which is working fine and replace it in the code. [In above code it shows as Form GUID.
You have to give this value at two places. First for __WebPartId and second for the <ID>g_[Form GUID]</ID>
Note that this is not the GUID of the list. You can create this GUID from Visual studio or many online tools are available to create one.
6) Provide the GUID of the list in the tag >ListName xmlns=”http://schemas.microsoft.com/WebPart/v2/ListForm”>{[LIST GUID]}</ListName>
7) Now you have to fill the Control Mode and Form type in the following tabs.
<ControlMode xmlns=”http://schemas.microsoft.com/WebPart/v2/ListForm”>%5BControlMode%5D</ControlMode><FormType xmlns=”http://schemas.microsoft.com/WebPart/v2/ListForm”>{FormType]</FormType>
Control mode and Form type differs for each form.
NewForm.aspx : ControlMode = New, FormType = 8
EditForm.aspx : ControlMode = Edit, FormType = 6
DispForm.aspx : ControlMode = Display, FormType = 4
8) Save the page and view the page in the browser. The broken links should be fixed.
Great post .Thanks a lot .
A very BIG thanks!!!
You save my …..
“you know 😉 “
Fantastic!! Worked like a charm. Saved us BIG TIME!
For me it doesn´t work 😦
Make sure you follow the steps correctly..
I may help you if you provide more details 🙂
Thanks so much. It save my work.
Many thanks! You’ve saved me a lot of time and effort – God blessed!..
Many thanks!
a big big thanks from China! broken link restore now! You are god!
Thank you SOO much. After I read that I had to delete the list and recreate it (700+ items, 50+ different views) my world collapsed. You are a life saver.
This solution didn’t work for us as we destroyed our dispform and lost all links from the list as described above but the above solution didn’t work. We followed this link (same process but much more detailed steps and controls) and it works .. automatically sharepoint restored the links on all list items for viewing (which were going to root site) and now everything works.
Yours,
Tarik
http://www.iamwealthytoday.com
http://support.microsoft.com/kb/2000861
THANKYOU! You also saved my a!@
I did have an issue where a multi-select control wouldn’t populate properly afterwards.
Using underscores instead of dashes in the guid for g_[Form GUID] part seemed to fix it.
This saved my a– as well. First article returned in google, gotta love it.
HI,
Many thanks for the post, it has saved lot of my time