My problem: I "accidently" deleted the NewForm.aspx and then I got the errors:
If you click New to create a new item in the list, you receive the following message:
Invalid page URL:
If you click an existing item in the list, you receive the following error message:
An unexpected error has occurred
I had a backup copy of my NewForm.aspx, but it did not work to just put it back into place.
(see also here: http://support.microsoft.com/kb/935504)
I also had the field "new item form" in list properties empty (see image) and I could not fill the value. Whenever I saved a change it was empty again, when I called the properties again.
Here I found my rescue:
To view the original information: http://blogs.msdn.com/dszabo/archive/2007/02/20/custom-list-newform-aspx-ruined-in-wss-3-0.aspx
This is just to keep the information in case Davids page might be unavailable:
1. Open NewForm.aspx and EditForm.aspx in Sharepoint Designer
2. Copy the code for the ListFormWebPart control from the EditForm.aspx. The code in question reaches from
down to
3. Paste it into the broken NewForm.aspx, I pasted it right below the Line:
4. Within the pasted lines of code look up the lines starting with
< ControlMode
and
< FormType
In the "Control mode" tag replace the "Edit" with "New", in the "FormType"-Section replace the digit "6" with "8".
5. Before saving, you have to generate a new GUID for the pasted control in your NewForm.aspx otherwise your EditForm.aspx will be broken after saving!!!
There are online GUID generators on the internet so you don't need Visual Studio, e.g.:
http://www.somacon.com/p113.php
Generate a new GUID and asign it to the "__WebPartId" attribute in the very first line of code of your control:
< WebPartPages:ListFormWebPart runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{YOUR_NEW_GUID_HERE}" >
6. Look up the
Before:
After:
7. Save your work...and your done!
Addition by me: After this rescuing I got two ListFormWebParts in my Form - the old one and the new one. I just deleted the old one and everything was working again.
Kommentare