次の方法で共有


Custom list NewForm.aspx ruined in WSS 3.0

Yesterday, I spent 3 hours debugging what's the problem with my custom list after I changed its NewForm.aspx page.

Here are the symptoms: I went to SharePoint Designer 2007, opened NewForm.aspx, deleted the ListFormWebPart web part from it and inserted a Custom List Form (Insert/SharePoint Controls/Custom List Form). Then, I saved it. After I went back to my list and clicked on <New> to create a new item, I got the following popup: "Invalid page URL:" and that's it. The other symptom I found was that when I clicked on the items already created to see them (DispForm.aspx), I got a page with the following text: "An unexpected error has occurred. ", with no further information. I then browsed to NewForm.aspx, which worked well. So, the problem should be something like SharePoint can't find where to go to create a new item.

I then started troubleshooting the problem: back to SharePoint Designer, reset back the page to the site definition, with no luck. Back to SharePoint Designer again, checked the list properties, found that the New item form URL on the Supporting Files is empty. I restored back to the NewForm.aspx, still no luck. Of course, I ran IISRESET after every modification.

Then, I shifted to 2nd gear, set the configuration/SharePoint/SafeMode/CallStack parameter to true and Configuration/system.web/customErrors/mode to Off in web.config (under InetPub\wwwroot\wss\VirtualDirectories\<SiteName> ) to see the call stack on the DispForm.aspx (IISRESET needed then). Here it is:

Object reference not set to an instance of an object.

...

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]

   Microsoft.SharePoint.WebControls.NewItemButton.OnLoad(EventArgs e) +364

   System.Web.UI.Control.LoadRecursive() +47

   System.Web.UI.Control.LoadRecursive() +131

   System.Web.UI.Control.LoadRecursive() +131

   System.Web.UI.Control.LoadRecursive() +131

   System.Web.UI.Control.LoadRecursive() +131

   System.Web.UI.Control.LoadRecursive() +131

   System.Web.UI.Control.LoadRecursive() +131

   System.Web.UI.Control.LoadRecursive() +131

   System.Web.UI.Control.LoadRecursive() +131

   System.Web.UI.Control.LoadRecursive() +131

   System.Web.UI.Control.LoadRecursive() +131

   System.Web.UI.Control.LoadRecursive() +131

   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061

So, the problem occurres in the Microsoft.SharePoint.WebControls.NewItemButton.OnLoad method, which is in Microsoft.SharePoint.dll. So, I attached a debugger to w3wp.exe on the server, set a breakpoint to Microsoft.SharePoint!Microsoft.SharePoint.WebControls.NewItemButton.OnLoad (using WinDbg, the SOS 2.0 extension and the !name2ee and !bpmd commands), and checked where does it fail. Unfortunately, I have no source access to SharePoint 2007, but I could reverse engineered with Lutz Roeder's .NET Reflector, then debugged the assembly code and found that the code fails on the following code line:

base.NavigateUrl = base.Web.GetServerRelativeUrlFromUrl(base.List.Forms[PAGETYPE.PAGE_NEWFORM].Url) + "?Source=" + SPHttpUtility.UrlKeyValueEncode(SPHttpUtility.UrlPathEncode(this.RedirectUrl, true));

We are failing at the red call when we try to retrieve the Form item. We are not even getting the Url property of the Form, this is why we get the “Object reference not set to an instance of an object” hresult. It seems that there’s no PAGETYPE.PAGE_NEWFORM item in the Forms collection. I guess, this is what I can set on the list properties with SharePoint designer (display, edit and new form Urls). So, even if SharePoint Designer shows that the new form set fine, SharePoint can't get it.

Then, I started a Profiler Trace on the SQL Server to check what's the problem. After started the trace, I opened the list properties from SharePoint Designer and captured the SQL calls going to the WSS database. The spotlight went to the following stored procedure then: proc_GetListWebParts. I found that this sp produces a line for each webparts related to a given list. In my case, it produced 2 different lines for the new page webpart. So, the problem seems to be that SharePoing gets too much information and can't decide which New Page is the real one.

I could fix the problem by hacking the AllDocs and WebParts table, but my WSS 3.0 is in an unsupported state now. If you can't do anything else, the point is that you have to have one line for each web part and you have to do different modifications in the tables above to fix the output of this stored procedure. I also found that if you don't have a ListFormWebPart web part associated with your list on the NewPage.aspx page, you won't get a record to these tables. It doesn't make sense to write more details here, the best thing is if you take a look at the proc_GetListWebParts sp's code and find how the output is produced. The whole thing could be a bit messy.

The problem is that I can't repro the very same problem in my test environment, so the problem could be something specific to my Customer's test environment where I found the problem. I hope that it helps at least localize the problem for someone else. Unfortunately, I don't know any *SUPPORTED* solution for this problem at the moment. If I'll have any updates, I'll follow up on that. In the meantime, if you experience the problem, please write a comment here!

POST-COMMENT: RESOLUTION

Just a quick update - in case if you want to customize your edit form and you haven't "ruined" it yet: hide the ListFormWebPart control and insert the Custom List Form control to your page. You can use this control to customize your form's fields. I published a KB article about this issue at the following location:

Error message when you click "New" to create a new item in a list or when you click an existing item in SharePoint Server 2007: "Invalid page URL" or "An unexpected error has occurred" support.microsoft.com/?id=935504

This is a bug in WSS and might be fixed in the future releases.

POST-POST COMMENT: ALTERNATIVE RESOLUTION

There were many different solutions posted to the comments section in my blog post in the last period of time. Tim Frodermann was kind enough to summarize the best resolution from myang and AngelIndaux:

Here is what I did from A to Z to recover my ruined NewForm.aspx (based upon myang's and AngelIndaux's posts):

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

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

down to

</WebPartPages:ListFormWebPart>

3. Paste it into the broken NewForm.aspx, I pasted it right below the Line:

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

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.:

<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 <ID></ID>-Tag further below (it was about 27 lines below in my case) and change a random number in the ID, e. g.

Before: <ID>g_092cc5f1_f97c_408b_bf66_c7b235af38f9</ID>

After:

<ID>g_092cc5f1_f97c_408b_bf66_c7b235af38f5</ID>

7. Save your work...and your done!

POST-POST-POST COMMENT: YET ANOTHER ALTERNATIVE RESOLUTION

Josh Fraser came up with an alternative solution – thanks Josh for sharing it:

“If you leave the NewForm.aspx just the way it is, create a copy and use the copy to create your custom form, it works like a charm. You can even delete the list form web part from the custom page. WSS can be an odd arena to play in some days.

One thing to note: when you create a custom New/Edit/View form you need to right click on the list in sharepoint designer and select "supporting files" ensure that the new page for "Item" is pointed to the new ASPX file:

clip_image002”. Thank you Josh, again!

Comments

  • Anonymous
    March 07, 2007
    I have the same problem and can't find out how to fix.  Even recreated site and change the newform page again and the same thing happens.

  • Anonymous
    March 07, 2007
    Thanks for the details - we are having the EXACT same problems with our Events List.  Any further details you might find on this would be appreciated.

  • Anonymous
    March 08, 2007
    I'm having the same issue.. the MS site http://office.microsoft.com/en-us/sharepointdesigner/HA101191111033.aspx shows you how to do it but when it comes to to associate the new page it doesn't do it. It just seems flakey.

  • Anonymous
    March 12, 2007
    Hello there, I'm sorry for the late reply, I was OOF and spent a nice few days in Dublin with my wife. Have you deleted the ListFromWebpart webpart from NewForm.aspx? If you did so, that could be the problem. I found that without this control, the NEW action simply doesn't work. If you want to design you own input panel, you can hide the ListFromWebpart webpart.

  • Anonymous
    March 13, 2007
    Hi there, I am having the same problem as Boxy. I followed the Microsoft article and everything works fine until I tried to associate my new form in the properties. I browse to the new .aspx file which I created to use to create new form and then close the properties window but when I go back in again I found that the new form file is pointed back to SharePoint default one again. It seems that this this property can not be changed. and no matter what I rename the default NewForm.aspx to this property can always find and point to that, it seems that there is a link between them but I am not sure where this linkage could be. Can anyone here help me please? Thank you

  • Anonymous
    March 14, 2007
    Hello, Looks like the same issue I posted here. What do you get from proc_GetListWebParts? I guess, you'll have 2 different lines for the NEW command.

  • Anonymous
    March 14, 2007
    Hi, Thank you for your reply. But I don't quite understand... where do I find the proc_GetListWebParts and NEW command? I made a new 'NewForm.aspx' from scratch by inserting a sharepoint control and that's all I did. Sorry, I am very new to SharePoint.

  • Anonymous
    March 18, 2007
    Hello Bing, If you don't have a ListFormWebPart control (this is the control that renders you the edit controls) on your NewForm.aspx page, SharePoint won't accept the page as a "New item form" even if you can select it in SharePoint Designer. The only workaround I found was to keep the ListFormWebPart on the page, but hide it. If you already deleted this control from your page without backing it up, you could face another challange by re-creating the control (you can do it with SharePoint Designer - Insert -> SharePoint Controls -> List Form, but it's buggy). In this case, it's easier to re-create the list, instead of hacking the XML tags in the page.

  • Anonymous
    March 18, 2007
    Hello again Bing, Here's some more information to help you: I wrote few lines of SQL code to check your configuration. Please

  1. Open SQL Management Studio on your MOSS Server,
  2. Connect to the local SQL Server
  3. Click on the New Query button
  4. Select the "WSS_Content" SQL database on the toolbar
  5. Fill out your list's name and your SharePoint admin user name in the code below
  6. Run the code by hitting F5 or Ctrl+E
  7. Post your output here declare @ListName nvarchar(100) declare @UserName nvarchar(100) -- TYPE YOUR INPUTS HERE set @ListName = 'NewList2' -- Your list's name set @UserName = 'TestUser' -- Your SharePoint admin user's username set @ListName = '%' + @ListName + '%' set @UserName = '%' + @UserName + '%' declare @ListId uniqueidentifier declare @UserID int declare @SideId uniqueidentifier select @ListId = tp_ID from AllLists where tp_Title like @ListName select @UserID = tp_ID from UserInfo where tp_Login like @UserName select @SideId = tp_SiteID from UserInfo where tp_Login like @UserName exec proc_GetListWebParts @ListId, @UserID, 0, 0, 0, @SideId
  • Anonymous
    March 23, 2007
    So how exactly are we supposed to edit the NewForm.aspx?  I this insane or what?  It seems like anything you try to do in SharePoint breaks something. How would I simply change the "Column Name 1" text to not wrap? Stupid SharePoint!

  • Anonymous
    March 25, 2007
    Hello Thomas, Yes, I feel your pain! Try Forms Services with browser-enabled forms instead! If it doesn't want to work, check out my blog entry at http://blogs.msdn.com/dszabo/archive/2007/03/22/configuration-tasks-needs-to-be-done-to-work-with-infopath-forms-services-and-browser-forms.aspx Cheers,   David

  • Anonymous
    March 28, 2007
    The comment has been removed

  • Anonymous
    April 02, 2007
    Dave, the easiest resolution is to delete the list, re-create it and don't touch NewForm.aspx at all. If you still need to touch it, make sure that the ListFormWebPart webpart remains on your page (you can hide it). The best solution is to use InfoPath Forms Services for input panel customizations. David

  • Anonymous
    April 04, 2007
    I also had the same problem! But it happened for me a good time after my user's have been using the Help Desk template. So to recreate the whole thing with my customizations to it is going to be a real pain in the neck, but such is life! Thank you David Szabo for the solution on keeping the ListFormWebPart hidden. I am going to do this now when I recreate. BTW - this change to just NewForm broke all of my forms, including DispForm and EditForm. This happen for everyone else also? Thanks!

  • Anonymous
    April 04, 2007
    Thomas, i forgot to say in response to you, every time I make a change to sharepoint code I cringe with fear as I refresh the page, so I feel your pain!

  • Anonymous
    April 04, 2007
    Hi Chad, Content Types could make your life easier, as this way you don't have to re-create the whole list with all of its fields, just create an instance from an existing content type. Of course, you couldn't aware of the fact that your list will need to be re-created, but for the future, I suggest doing it this way. Yes, all the other list pages got ruined. Cheers,   David

  • Anonymous
    April 05, 2007
    ...Simply select the "Content Type Specific Forms" from the DropDown listbox in SharepointDesigner ... (the default for me was "folder", u must match with your content type ie "contact","event"..) Bye. Enrico

  • Anonymous
    April 24, 2007
    The comment has been removed

  • Anonymous
    April 25, 2007
    I started having the same issue.  I tried everything mentioned in this blog.  The only thing worked for me was to reset default.master to the site definition.  Everything works now.

  • Anonymous
    April 25, 2007
    The comment has been removed

  • Anonymous
    April 25, 2007
    Arif, did you have a clean English RTM installation?

  • Anonymous
    April 27, 2007
    The comment has been removed

  • Anonymous
    April 29, 2007
    Yes Chris, you are right, it's totally unsupported but that was the way I solved it in my virtual environment too.

  • Anonymous
    April 29, 2007
    If you are using SPD to customize the NewForm.aspx you need to be aware of this: Error message when you

  • Anonymous
    April 29, 2007
    I also have met this problem.It makes my project delay,what a pity!I can't bear it again!!!

  • Anonymous
    May 13, 2007
    i hv also created custom list an d getting the following error Cannot complete this action. Please try again.   at Microsoft.SharePoint.Library.SPRequestInternalClass.CreateListFromFormPost(String bstrUrl, String& pbstrGuid, String& pbstrNextUrl)   at Microsoft.SharePoint.Library.SPRequest.CreateListFromFormPost(String bstrUrl, String& pbstrGuid, String& pbstrNextUrl) I am not able to find the problem.

  • Anonymous
    May 15, 2007
    preeti, is it an upgraded site (v2->v3)? If so, is it still running in SharePoint 2003 compatibility mode? Do you have the appropriate rights to create the list?

  • Anonymous
    June 06, 2007
    Dszabo, I am running an upgraded site (v2->v3).  How do I know or check if I am still running in SharePoint 2003 compatibility mode? How do I leave that mode?  Do I need to click "finalize upgrade"?  Are there any risks? My problem is that when I try to insert a custom list form, nothing really happens.  I've reinstalled sharepoint designer (trial) and done windows updates.  Is there a connection here?

  • Anonymous
    June 18, 2007
    Hi MatrixNeo42, Very sorry for the late reply. Will check the compatibility mode questions with my colleagues and come back to you. The way I would start troubleshooting the problem is to check the SharePoint error log file. It's located under C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12LOGS. It contains many useful information. It helped me solving such problems 100% so far. :) Cheers, David

  • Anonymous
    June 21, 2007
    MatrixNeo42, Checked and Finalize Upgrade has to take you out from compatibility mode. In SharePoint 2003, there was a command (stsadm -o upgrade -force), but it doesn't work on MOSS 2007 anymore. If you remain in compatibility mode after finalizing the upgrade, open a ticket at Microsoft Support.

  • Anonymous
    July 03, 2007
    I am using Application template that downloaded from microsoft website, and using 1 of the template. My question is, how can I modify the NewForm.aspx so that I can put some logic checking when the user press on OK button. In another words, before insert the data, I want to do special business rule checking upon the user click on the OK button to save the entered data. Can anyone help me? Thanks in advance.

  • Anonymous
    July 03, 2007
    Hey Alex, yes, you can do that definitely. Do you want to do it on the client side before the form is submitted to MOSS or you want to do it on the server side after the form submitted?

  • Anonymous
    July 04, 2007
    Hi dszabo, I need to do in server side. Actually, I am modifying the Application template "RoomEquipmentReservations" that downloaded from microsoft website. And everything fine for this template except, I want to add extra validation upon the user click on the save button (Add New item). I am not allow the user to overlap the time. For eg. If someone already booked meeting room A for a particular period, then other user can not book anymore. Please advice. Thanks in advance.

  • Anonymous
    July 04, 2007
    Hi Alex, I don't know this application template specifically, but I guess it stores the reservations as list items. What you can do is to (1) develop your own own custom a workflow action and you can set up a workflow for this specific list, (2) create a brand new workflow programmatically and associate it with the list or (3) if you want a low-level solution, you can write an event sink that relies on modifications/creations against this specific list. Check out more information at http://www.microsoft.com/downloads/details.aspx?familyid=6D94E307-67D9-41AC-B2D6-0074D6286FA9&displaylang=en or drop a question here or by email to me to [dszabo at microsoft dot com]

  • Anonymous
    July 05, 2007
    David,  I gatta same problem, whenever i click 'displayForm, it will redirected to homepage...any an idea to solve this issue?

  • Anonymous
    July 06, 2007
    Hi, i had created a sharepoint blog site and now in the post list there is the "Newform" problem. I can't delete the post list how can i resolve the problem?

  • Anonymous
    July 16, 2007
    With this finding, is their documentation on how to correctly modify the newform.aspx, displayform.aspx, and editform.aspx pages in a supported way?   Following the recommended steps, I don't see how you cannot delete the webpart after you hide it? This was the blog where I learned how to do it the original way... http://blah.winsmarts.com/2007-5-Customize_the_-and-quot;NewFormaspx-and-quot;_page_for_a_SharePoint_List.aspx

  • Anonymous
    July 17, 2007
    Hi Ben, yes, there's a documentation on Office Online, but the point is that this is a bug in WSS. I don't understand your 2nd question. Can you please clarify it? The easiest way to have a custom form page is to hide the ListFormWebPart control and insert the Custom List Form control to your page as your blog entry mentioned. Thank you, David

  • Anonymous
    July 17, 2007
    David, Thanks for the response.  I wasn't sure if the blog I referenced was "hiding" the ListFormWebPart or deleting it.   Regards, Ben

  • Anonymous
    July 17, 2007
    Yes, it wasn't really mentioning. Anyway, if you are not hiding the webpart but deleting it, your list will be ruined, so you did a grand job of researching about it before trying it out. :)

  • Anonymous
    July 26, 2007
    Thanks for this post and all the great comments it inspired.  I'm trying to do something similar and I'm not sure I understand the right way to go about this. I've created a new content type and list template which I want to deploy to multiple site collections via solutions/features.  I want my list template to come with custom DispForm, NewForm, and EditForm aspx pages to hide certain fields from my content type.  In SPD, if I create this page, I can't export it and use it with any other list from the same template b/c the SPD-generated page references the ListID GUID. If I understand this post correctly, what I need to do is basically code each one of these pages from scratch and have it define the rendered fields in code.  There doesn't seem to be a way to create a generic page from SPD

  • Anonymous
    July 29, 2007
    Hi Matt, Use the list's name instead of its ID: modify the DataFormWebPart in the page's code. Cheers!

  • Anonymous
    August 10, 2007
    Another SPD issue with modifying form pages... If you want to modify a new item, edit item or display item page for a list or library where you are attaching a file - you will lose the ability to attach the file in your modified page. This posting has been receiving a large number of views in the MSDN forums. http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1104194&SiteID=1 If anyone has found a solution for this issue, that would be greatly appreciated.  

  • Anonymous
    August 13, 2007
    @Matt, David, I need to do something similar: We have modified our default document content type to enforce metadata, but have come across a problem with web part pages. The form does not pick up a "title" value from the "create" page, so the new item is left "checked out". If we try to edit the item's properties, there is no "title" field to edit. We need to modify the editform.aspx to include a title field. As we have thousands of sites in the wild, we cannot consider using frontpage to modify the sites. What approach is best here? Thanks. Mark

  • Anonymous
    August 14, 2007
    The comment has been removed

  • Anonymous
    August 15, 2007
    Hi, I want to modify the respond to survey page in MOSS 2007. The problem is I want this change to persist to all new surveys created in that site. Means I am modifying the default functionality of the Finish button in newform.aspx page of one survey, but this does not reflect to other surveys created in site. Can I achieve this ?

  • Anonymous
    August 21, 2007
    Hi dszabo, Thanks for the post, but I have now a problem. I customized an EditForm.aspx and everything works fine until I click on the "Check In" button (after uploading a doc). The document is only saved and remains checked out. Is there a way to either correct the behavior of the button or to change the label to 'OK'? Thanks, Edgardo

  • Anonymous
    August 22, 2007
    This is very bad ... blows the whole purpose of using the designer for key lists.  This needs to be fixed like immediately.  This is unnacceptable ... what has Microsoft said about this as it seems to be known for quite some time now (how did their testing miss something like this ... My first training bit to go through customizations and BAM ...) Oh well ... Anyways ... hiding strategies?

  • Anonymous
    September 08, 2007
    This works but I do not like it: Just get your list guid id from SPDesigner source view and run the following command: ============================== Update WebParts Set tp_Flags=1048576 WHERE     (tp_ListId = 'your_list_guid') and tp_ID=(select top 1 tp_ID from  WebParts where (tp_ListId = 'your_list_guid') order by  tp_CreationTime desc) PLEASE CHANGE tp_ListId to your list id. ==================================== the result is immediate.Just close the page in SPDesigner and open it again,the 'can't render webpart' error will go away. BUT THIS IS JUST A WORKAROUND :).I still do not know how this affects the moss site.

  • Anonymous
    September 12, 2007
    Issue:- In a share point picture library. When user click on a picture, by default the picture open in the DispForm.aspx with default toolbar (SharePoint:FormToolBar) having options

  •          Edit Items
  •          Delete Item
  •          Manage Permissions
  •          Mange copies
  •          Check Out
  •          Alert me We need to customized it, so that the DispForm for this picture library will show toolbar having options only
  •          Edit Items
  •          Delete Item
  •          Alert me This customization should not affect other picture library running on the same server. Should be applicable for a particular picture library site only.
  • Anonymous
    September 19, 2007
    Avi4tech, you can disable the standard toolbar on the Edit page: open SharePoint Designer, open the edit page for editing, right click on the List Form webpart, choose List Form Properties and uncheck the Show Standard Toolbar checkbox. After that, you can create your own toolbar on the edit page.

  • Anonymous
    September 21, 2007
    Hi dszabo,  Thanks for the post regarding Dispform.aspx.  I have tried disabling Standard toolbar of Dispform.aspx of Picture libary using Designer.  Added my own custom toolbar in DispForm.aspx.

  • Anonymous
    October 03, 2007
    Hi, we have an customized list and want to customize NewForm.aspx and EditForm.aspx. Then we have some BDC fields, and they are not saved in the list when we ues the customized forms. We have done like suggested and only hidden ListFormWebPart and then inserted Sharepoint controlsCustom List Form instead. It seems to works for normal fields but not for BDC fields. Any suggestions? /Mikael

  • Anonymous
    October 30, 2007
    Thanks for the article. Hiding the ListFormWebPart was the trick we needed to get the new button working again.

  • Anonymous
    November 20, 2007
    Hi, I had the same problem. Some developer accidentally deleted the NewForm.aspx of some List and we couldn't bind the newly created NewForm.aspx to the list. I used the query solution from Madani Benghia and it worked out. However, web part properties is all messed up. It displays the whole page instead only the property pages for the selected web part. I got to this because I was trying to hide the list form web part.

  • Anonymous
    December 05, 2007
    Whoaa lots of comments. Just like to mention that I had a similar problem editing EditForm.aspx in the designer. After editing, then I had the problem that when editing List items derived prom the folder content-type (with extra columns), EditForm.aspx showed the only the fields "content-type" and "Title" - and failed to display my additional columns -> I go scared and clicked "Return to definition" in the designer for that form and to my horror the problem remained. I tried everything and also ended up recreating the list from scratch (all content-types, views =((). Another thing that happened to me is that when trying to fix the broken EditForm.asp by copying it in the designer (right mouse button on the file in the tree-view, then copy, then click on the forms dir. of the broken list and past) It threw an error saying that I couldn't copy this kind of form between lists. and then it BROKE the EDITFORM.ASP of the WORKING list! Actually it replaced the property ListNew/Forms/EditForm.aspx for ListBroken/Forms/EditForm.aspx and when I tried to change it back it threw an error about unable to transfer between lists. So people: do not use SharePoint designer to edit you list forms and if so I'd recommend:

  1. make an stp (or cmp) backup including data.
  2. create a copy of the form and edit that then set your list to point to it.
  3. pray.
  • Anonymous
    December 06, 2007
    Is it possible to "embed" the custom list form webpart in the list definition ? I did the modifications in SPD to add the custom part, and hide the listfromwebpart. Then I used the Sharepoint solution generator to "extract" the list definition. But the extracted template does not include the webparts definitions (nor standard listform WP or custom WP). The pages contains only the webpart zone definition. My objective is to create a list template (as a feature) wich include a special columns to display in allitems.aspx but hide it in dispform.aspx. I don't find a way to do that. Any idea ? Thks

  • Anonymous
    December 19, 2007
    Has anyone tested this under SP1 and seen it has been fixed?

  • Anonymous
    January 22, 2008
    i customized the NewForm.aspx in sharepoint designer, after that iam not able to add the attachments to that list, it is showing java script elert messe like the field was modifided. so how i have to solve the problem, please help on this, i searched so many blogs i didn't find any solution on this. please help me

  • Anonymous
    January 31, 2008
    The comment has been removed

  • Anonymous
    February 01, 2008
    The comment has been removed

  • Anonymous
    February 07, 2008
    I have a unique problem...i dunno whether im the first one up with it ...im trying to create a custom new form for a calendar....everything works fine when i follow all the steps given above...until i check the recurring events checkbox or the all day event checkbox...when i do that i get the same ##**#"!% an error has occurred message...... Please help...i have followed all steps given here word for word and from other places as well...to no avail...

  • Anonymous
    February 07, 2008
    Hey Niks, set the configuration/SharePoint/SafeMode/CallStack parameter to true (as mentioned in the blog) and search for the function names on the internet. If you find anything, post it here, please. If not, post your call stack. Cheers!

  • Anonymous
    February 07, 2008
    Myang: wow, it's great to see that someone found an alternative solution for this! I'll check it out when I can! Thanks again!

  • Anonymous
    February 14, 2008
    My solution.  I uninstalled the evaluation edition and installed a fully licensed version and then everything worked fine.

  • Anonymous
    February 19, 2008
    Did anybody solve the "nothing happens" after inserting custom list form? i've been dealing with this problem for a long time, seen lots of posts about it , and no solution :-(

  • Anonymous
    February 26, 2008
    myang ... you saved my HOURS of work.  THANK YOU!  Your copy/paste with edits worked in seconds.

  • Anonymous
    February 28, 2008
    Im another one with the "nothing happens problem" when inserting a custom list form. There must be someone out there that has solved it?? /M

  • Anonymous
    March 17, 2008
    Wow quite a read... I found creating a new page and form altogether was easier. If you want to make it your default put this in an appropriate position in the default form. <script language="javascript">window.location="MyCustomForm.aspx" + window.location.search;</script> This will work for Edit and display forms you don't need to add "+ window.location.search" to new forms as it doesn't need to pull original information to display. only downfall was pressing backspace has issues on the custom form. Like I am worried about such a small problem anyway...

  • Anonymous
    March 28, 2008
    Any news on re-enabling attachments to this custom form?  Losing the ability to add attachments renders customizing New/Edit forms null and void?

  • Anonymous
    April 10, 2008
    The customization of NewForm and EditForm will result in the Attach file breaking, this link is helpful but distressing. With each day comes new issues with Sharepoint (WSS3 for me) that have me wondering if I am working in a production system or a BETA system that is dressed up like a production system.  Pathetic. http://forums.microsoft.com/msdn/showpost.aspx?postid=1104194&siteid=1&sb=0&d=1&at=7&ft=11&tf=0&pageid=1

  • Anonymous
    April 10, 2008
    the above link was also referenced by Ben earlier in the list, sorry for the duplication, just frustration showing through in some of the asinine bugs (WSS workflow IDs must be lowercase, but you must read blogs to find it since the documenation is sparse and most of the books "assume" that this is known behavior).  

  • Anonymous
    April 10, 2008
    is it possible for you to post the "edit the database" version of this fix? recreating the list isn't an option for me due to other list relationships. I understand it won't be Microsoft-supported but I don't have much of a choice.

  • Anonymous
    April 20, 2008
    Nothing happen problem again... Anyone know how to solve this issue? "Nothing happen when inserting custom list form in sharepoint designer"

  • Anonymous
    April 21, 2008
    Hi, How does the branching for surveys in MOSS render? I recently created a page and embed the survey (with branching) on it. After publishing the page, I tried to use the survey with the branching capability. When I clicked respond to this survey, you can see that the URL shows the ?Source=URL of the page where the survey has been accessed. In a survey that does not allow branching, once the submit (Save) button is clicked then users wil be redirected to the page where the MOSS survey is embedded. Now when I accessed the survey with branching, after answering the first question and clicking Next, I am redirected to another page with the survey question and this time the URL appears like this: EditForm.aspx?ID=4&FirstField=Why_x0020_is_x0020_this_x0020_yo. So when I click Submit or Save, I am brought to the Survey List page and not anymore to the page where i have embedded the MOSS survey list? Is this a behavior of branching for MOSS survey list? What do I need to do to follow the behavior of the survey even with the branching capability? Thanks, Jaimes

  • Anonymous
    May 01, 2008
    Here's a HUGE thank you for posting the information on this pesky issue. I tried a number of things in a very short period of time (with my phone ringing off the hook and email coming in like a waterfall) but no joy. I then tried myang's solution and WHAM! Fixed! I just can't express how happy I am... now I get to go home LOL THANK YOU!!

  • Anonymous
    May 08, 2008
    Thanks to myang, I could convince my calendar to work again but in calendar-view items won't display in DispForm.aspx any longer but in EditForm.aspx instead.

  • Anonymous
    June 04, 2008
    "Nothing Happens" problem, solved. Goto the Central Administration site, click on Operations then at the bottom of the screen click on "Data Retrieval Service". Now make sure "Enable these data retrieval services" is checked (on the right first on the list), save and restart IIS for good measure.

  • Anonymous
    June 04, 2008
    myang's solution worked like a charm for me. Thanx guys!

  • Anonymous
    June 10, 2008
    I had the same problem, and solved thanks to myang. But....I have another issue. Even if the "New form" works fine...when trying to make it run from a mobile view with the "/m" option, when I go to my list, I can not see now the "New Item" link. so I can not create more items from mobile view. Does anyone have the same problem and any solution ? thanks in advance !!!

  • Anonymous
    June 24, 2008
    So I ran into this problem twice before being directed to the msdn article, which referenced a MS support page that referenced this page. After recreating my list and following the recommended guidance (hiding the ListFormWebPart instead of deleting) I started to recreate the custom functions I wanted to have initially. I created a new page using "New from Existing Page" so as not to corrupt the main DispForm.aspx (still not deleting the ListFormWebPart). The new page was called AddTask.aspx and for some reason is now being called up when you click to view an item from the list (instead of DispForm.aspx). This isn't as bad as the first scenario where it didn't know where to go, but it is still essentially broken. You may want to add to your guidance that duplicating the ListFormWebPart could have consequences as well. Sorry I can't provide specifics, I thought I was proceeding correctly and didn't notice initially that I had broken anything. I hope you're able to find a solution or that the problem is fixed in the next iteratiion. Thanks for blogging about it though. These dev blogs are better than most product support sites.

  • Anonymous
    July 06, 2008
    Hi there, I tried myang's solution to the problem, which at first seemed to have worked. I copied the ListFormWebpart Control from the EditForm.aspx, inserted it into NewForm.aspx and edited it as recommended above. Opening the NewForm.aspx via the "New"-Button worked again then, but now opening the EditForm.aspx via an edit Button resulted in an 404 Error. Taking a closer look at the Code, I realized that Sharepoint Designer apparently had removed the Webpart from the EditForm.aspx by itself!!! This behavior is reproduceable: I copy'n'paste the Control Back from NewForm.aspx to Edit-Form.aspx, edit   <ControlMode xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">Edit</ControlMode> and <ControlMode xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">New</ControlMode> and save the page. Then opening the EditForm works again, but NewForm.aspx is broken again. Is there some kind of ID to these webparts that has to be altered when pasting the Control from EditForm.aspx to NewForm.aspx ??? It just seems as if Sharepoint accepts the webpart only in one of the two pages at a time... Bye, Tim

  • Anonymous
    July 07, 2008
    You need to create a new GUID with Visual Studio, and change it in : (WebPartId) <WebPartPages:ListFormWebPart runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{5C31247F-D13D-40C0-A4B8-A8A49C0DE99D}" > Then you have your EditForm with one WebPartID and the NewForm with another WebPartID. Also...some lines down... <ConnectionID>00000000-0000-0000-0000-000000000000</ConnectionID>  <ID>g_5c31247f_d13d_40c0_a4b8_a8a49c0de99d</ID>  <ListName xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm"> Just change one number of the ID section, so your Editform ID and your Newform IDS are different. Then it will work for PC views, but your "New Item" link will dissapear for your "/m" mobile views. I hope this will work for you !

  • Anonymous
    July 08, 2008
    The comment has been removed

  • Anonymous
    July 08, 2008
    Someone please tell Microsoft this... at least they won't recommend to recreate the list from scratch. That is just so idiotic given some sort of an alternative...

  • Anonymous
    July 21, 2008
    Thanks for this post! Saved me hours of work!

  • Anonymous
    July 31, 2008
    Great blog entry! Saved me a lot of work :)

  • Anonymous
    August 18, 2008
    Hi all! We have also a big problem. Unfortunately we managed to delete the DispForm at a document library. What must we modify on Tim's solution? For example at step 4 ("Control mode" and "FormType")etc. ? We would need your urgent help if you can. Thank you in advance! Csaba T.

  • Anonymous
    August 18, 2008
    Thanks man! The alternative resolution worked fine.

  • Anonymous
    August 20, 2008
    The comment has been removed

  • Anonymous
    October 22, 2008
    The comment has been removed

  • Anonymous
    November 19, 2008
    The comment has been removed

  • Anonymous
    November 22, 2008
    The comment has been removed

  • Anonymous
    December 03, 2008
    I have published a guide on my blog that shows you how to accomplish this within the Sharepoint GUI. No need to go into Designer for most folks on this one and if you do it the way I’ve laid out it doesn’t break anything. http://adambenjaminlowe.blogspot.com/2008/12/customizing-sharepoint-list-new-item.html

  • Anonymous
    December 03, 2008
    Hello dszabo,   I fix it according to "POST-POST COMMENT: ALTERNATIVE RESOLUTION", all things is OK, but only the link in calendar view is /Lists/myList/NewForm.aspx?ID=5, can you help me?

  • Anonymous
    December 03, 2008
    Hello dszabo, I fix it according to "POST-POST COMMENT: ALTERNATIVE RESOLUTION", all things is OK, but only the link in calendar view is /Lists/myList/NewForm.aspx?ID=5, can you help me?

  • Anonymous
    December 09, 2008
    Thank you so much.  I was able to restore my "broken" DispForm.aspx and then hide the standard ListView form and add my own custom one. Also - for those trying to do this for Display forms, the <ControlMode tag should be set to "Display" and the <FormType tag should be set to "4" Hope that helps. Thanks.

  • Anonymous
    February 18, 2009
    Thank you very much, you've been very helpful to me!!

  • Anonymous
    March 11, 2009
    This article has been a great help to me. unfortunately I have a list where the dispform is broken, although in the supporting files it is still mentioned. I can create a newform and a editform but when I change it to a dispform I get "a error has occured". And I cannot reset  the form back to the site definition. We have a hosted WSS3 site, what would be your recommendation for the next move?

  • Anonymous
    March 18, 2009
    Because of the broken Attach File issue when modifying NewItem.aspx, I did not modify this page. I need to be able to attach files to a list item and subsequently have others open these attachments. I have modified the EditForm.aspx and DispForm.aspx files - does this mean that I will not be able to even open the attachment that was originally attached on the NewItems.aspx page? How can I fix this? Please help!

  • Anonymous
    March 23, 2009
    MS has acknowledged a problem when trying to attach customized forms.   Here are the links (I think one is for the client side, one for the server). http://support.microsoft.com/kb/953271 http://support.microsoft.com/kb/960311

  • Anonymous
    March 23, 2009
    Sorry - I should have said MS acknowledged an issue when trying to add attachments to a customized form.   Here are the links... http://support.microsoft.com/kb/953271 http://support.microsoft.com/kb/960311

  • Anonymous
    April 02, 2009
    Thank you so much!  What a huge help.

  • Anonymous
    May 12, 2009
    Thanks David! This really saved my bacon, I had captured all my data and then realised that both Edit and New forms were broken. Copying the ListControl Web Part from the DispForm.aspx also does the trick. :)

  • Anonymous
    May 18, 2009
    I found a similar way to resolve the issue. I had deleted the Original web parts on both new and display forms, and tried to build custom forms. This obviously didn't work. After reading this and other pages, i found that if I search the content database of sharepoint for the form and web part ids I could filter the web parts table down to the two missing ids. Then it's just simply putting back in the generated form parts with the id left from the database. To filter out working web parts, every item list generates ids for every page just open each page grab the id and add it to the query... took about 20 mins.

  • Anonymous
    May 18, 2009
    David, wow, your post saved my bacon!!!!!  thank you so much.  I had modified my NewForm.aspx not expecting it to cause a disaster - was I ever wrong.  Your post saved my site -and possibly my job.  Thank you, thank you, thank you. Sincerely, Nick DeAngeo

  • Anonymous
    May 18, 2009
    Hi Nick, I'm glad that it has helped - tough times, yes ... :)  Good luck!

  • Anonymous
    May 21, 2009
    There is a drawback with the solution Josh Fraser provided. After doing so the WbePart properties dialog is broken for that form from within SharePoint Designer.

  • Anonymous
    June 29, 2009
    David, This (Post-Post by you, Tim, myang & Angel) worked great for me, and saved me from having to re-do a lot of customization work. Somehow I had deleted NewForm.aspx, so I copied EditForm.aspx. Well, the first time thru THAT didn't work. SharePoint did take me to the Repair Console, which let me delete the list, then I just followed A to Z and now it works like a charm! Thank you all very much!

  • Anonymous
    July 09, 2009
    Hello! I have a such problem but with DispForm.aspx I had deleted this file. And after it I put my own DispForm.aspx page from Visual Studio. As result: From Allitems view when I push the button for view the item - its redirected to  http://portal/?ID=5 Can you help me?

  • Anonymous
    July 16, 2009
    The comment has been removed

  • Anonymous
    August 07, 2009
    The comment has been removed

  • Anonymous
    August 25, 2009
    I have re-created list. and i have done changes as you mentioned above. but still same error exists

  • Anonymous
    August 26, 2009
    Post post worked very nicely for me.  The alternative was not pretty.  Thanks!

  • Anonymous
    September 24, 2009
    The comment has been removed

  • Anonymous
    December 23, 2009
    POST-POST COMMENT: ALTERNATIVE RESOLUTION thank you thank you thank you !

  • Anonymous
    January 04, 2010
    Customizing the Event Calendar newform.aspx. Leave the newform.aspx alone.  You will create a custom content type instead. Step 1 – Make the event content type available to use as a parent type (by default, it is in the _hidden group).   In an existing calendar on your site, choose “List Settings” Click advanced settings and choose “Yes” under Allow management of content types?  When you click OK, you will now see “Content Types” and “Event” under the list settings.  Click on the hyper-linked text “Event” under Content Type Header.  Near the top of the page you will see “Parent:  Event”, click the hyper-linked text “Event”  Change the group from _Hidden by clicking on the “Name, description and group hyperlink and choosing one of the other groups (that are not hidden!).  I like to use “Custom” or  “List Content Types”.   Step 2 – Create a new content type.   Site Actions / Site Settings / Site content types / Create /    Name it something appropriate, select your Grouping used above (Custom or List Content), then “Event” for the second level parent content type.  Again choose an appropriate Group for your custom content type (I like Custom Content Types).   Step 3 – Add your content type and consider hiding the regular event type. In your calendar, go into List Settings.  “Add from existing site content types”  Choose your grouping, then your content type and “Add”.  Click “Change new button order and default content type” Make “Event” not visible by unchecking it.  Make your content type the default content type by making it number 1 in the Position from Top.  Click OK You can make edits to your content type by adding, subtracting and column order. Now your “New” item form matches your needs.

  • Anonymous
    January 04, 2010
    Hi You all seem to be the people in the know, would you be able to answer two questions for me? 1: I have a custom list with lots of columns in it. Only 5 or 6 of these columns are required for the New item page. I was going to create a new New item page for these. I was also planning on amending the edit and display pages to show all the columns but be grouped into 3 areas with headings and shadings etc to neaten it up. I would need to be able to add attachements to it. Going over this blogg does this mean I will not be able to add attachements if I create new NewEditDisplay pages? Am I using the right method for what I want to do? 2: I created a new New item page on a test custom list whilst playing with SPD. I went to the list properties of the custom list on SPD and changed New item to the new page I had created, clicked Apply, Clicked ok, Saved. Went into SharePoint and nothing had changed. Went back into SPD, list properties and it was still using the SPD default new item... Has anyone else had this problem? Thanks Al

  • Anonymous
    January 05, 2010
    The comment has been removed

  • Anonymous
    January 07, 2010
    The comment has been removed

  • Anonymous
    March 19, 2010
    Is there a way to modify the EditForm.aspx so that it loads a new window instead of changing the existing page to a new page?  And also where can you change so that after the user finish entering field, the Submit button will close that page?

  • Anonymous
    August 25, 2010
    Great post.  Saved me a lot of trouble.  I was also experiencing the issue that kept the item checked out after it was edited in the custom editform.aspx page.  I was able to resolve this by going into the content type that the library was based on and making "Title" an optional field (vs required).  

  • Anonymous
    March 08, 2011
    Thanks dszabo... I think we can fix this issue in an indirect way without deleting the existing list(If there is huge data in that existing list) if we have a List template backup or any access backup of the same list. I got this technique from my Teamlead. Hope it works for you. The Major problem is with the Webpart ID. Once we have the Webpart ID we can fix this issue somehow indirectly in Sharepoint Designer. For this we need to recreate a new list without data. Open the sharepoint designer As we know whenever a list created automatically New, Edit & Display forms will be automatically created. We can use the Webpart ID of those each Forms. Copy the code of each Newly created Form from restored List to our Modified List Forms & be sure after copying that Form code, the list ID should be changed to our Current Modified List ID and Flag to 104876. Now our FORMS are ready with New Webpart ID's. Refresh the site and reopen the Sharepoint Designer. Preview the Forms in Browser... Magic... Everyform will work as before the customization had happened. But be sure don't delete that restored List. Thanks Rajeshkumar

  • Anonymous
    March 31, 2011
    The comment has been removed

  • Anonymous
    October 06, 2011
    What about when SPD won't take any changes to the Supporting Files properties of the list, for any content types? We're seeing this symptom yet again. Unghosting and reghosting the builtin forms isn't helping either.