SharePoint Blogs / SharePoint University
SharePoint Blogs and SharePoint University - all in one place!
Need SharePoint Training? Attend a SharePoint Bootcamp!

Please delete cookies related to sharepointblogs.com and sharepointu.com to resolve login issues!

Lesson Learned While Customizing Newform.aspx

Whenever you customize the default list forms (NewForm.aspx, Dispform.aspx, or EditForm.aspx) in SharePoint designer, never, ever, under penalty of torture using Ed Wood movies, ever, I mean ever, delete the default ListFormWebPart that is on those pages.  Doing this will subtly corrupt how your list is defined in SharePoint and can cause you all sorts of grief.

Supporting FilesThe most minor problem I've seen is that you lose the ability to specify the Supporting Files for the list.  Oh sure, it will look like you can set them and it will even save and refresh properly in Designer.  However, SharePoint will simply ignore that and go right along showing the default files instead.

The bigger problem is that deleting the ListFormWebPart from the NewForm.aspx page can effectively disconnect the "New" option on the list toolbar resulting in the ever annoying "Invalid page URL" dialog box when anyone clicks on it.  This is a known issue and the only way to fix it is to delete and recreate the list.  Not Fun.

FliEB

Instead, save yourself some grief when editing these pages and just leave those web parts on there and add a new DataFormWebPart above or below it and customize that to your liking. 

Note: make sure that you insert the new web part into the existing WebPartZone or else you will lose the 'Edit Page' option for that page on the Site Actions menu.

Once you have the customizations you want in place, you will need to hide (not delete!) the original ListFormWebPart.  To do this in Designer, simply change the IsVisible element in the WebPart XML to 'false'

FliF2

Alternatively, you can hide it using a browser as well.  Simply browse the page and edit it, either by using SiteActions -> Edit Page or by adding "&PageView=Shared&toolpaneview=2" to the querystring in the browser.

FliF0

FliF1Then edit the web part properties for the original ListFormWebPart and hide it

This keeps the original web part on the page which keeps SharePoint happy.  Your users only see the customized list view that you want them to see, which keeps everyone else happy.


Posted 11-14-2007 5:34 PM by DavidWise

Comments

SharePoint 2007 Link love: 11-19-2007, part three at Virtual Generations wrote SharePoint 2007 Link love: 11-19-2007, part three at Virtual Generations
on 11-19-2007 8:25 AM

Pingback from  SharePoint 2007 Link love: 11-19-2007, part three at  Virtual Generations

Parshuram Chenna wrote re: Lesson Learned While Customizing Newform.aspx
on 01-22-2008 3:07 AM

hi,

i would like to add a custom web part for the list in DISPFORM.ASPX page and hide the default ListFormWebPart webpart. This process i would like to have it at the time of creating a list on site provisioning.

Becoz the list gets created when the site gets provisioned through Site Definitions.

Ram

DavidWise wrote re: Lesson Learned While Customizing Newform.aspx
on 01-22-2008 10:20 AM

Ram,

I'm no expert on this, but I'm pretty sure that you can get what you are looking for by creating custom Features and including that logic and/or pages in there.

CleverWorkarounds » More SharePoint Branding - Customisation using JavaScript Part 3 wrote CleverWorkarounds » More SharePoint Branding - Customisation using JavaScript Part 3
on 02-28-2008 6:57 AM

Pingback from  CleverWorkarounds » More SharePoint Branding - Customisation using JavaScript Part 3

Tom Riddle wrote re: Lesson Learned While Customizing Newform.aspx
on 03-21-2008 6:59 PM

This is the most helpful post out of all of the ones I read on this issue. Thumbs up and hats off to you!

SharePoint, SharePoint and stuff wrote SharePoint Kaffeetasse #61
on 05-05-2008 8:47 AM

ToppTipp Microsoft SharePoint Administration Toolkit 1.0 ( WhitePaper ) x64: www.microsoft.com/.../details.aspx

Mirrored Blogs wrote SharePoint Kaffeetasse #61
on 05-05-2008 9:57 AM

ToppTipp Microsoft SharePoint Administration Toolkit 1.0 ( WhitePaper ) x64: http://www.microsoft.com

Slappy wrote re: Lesson Learned While Customizing Newform.aspx
on 06-26-2008 3:05 PM

This is all fine and good and VERY informative...

However, I've not found a fix for this, if one does delete said default ListFormWebPart from said .aspx file.  I mean "my bad", but it's not like "never ever under penalty of torture" was stamped in large Red Letters anywhere.  In fact there is surprising small amount of information on this subject.

Can a server restore bring you back to a time when all is good?

thanks

JimR20 wrote re: Lesson Learned While Customizing Newform.aspx
on 08-28-2008 8:19 AM

Have you found an answer to the problem of the attach button not working when you customize the NewForm.aspx.

Mike Atkins wrote re: Lesson Learned While Customizing Newform.aspx
on 09-22-2008 3:30 AM

Has ANYBODY found a way to recover from deleting the List Form?  Re-creating my List does not look like an option now, and my client is not too disposed to accept that this is a Microsoft problem. I am stuck, with my reputation on the line!!

David Goebel wrote re: Lesson Learned While Customizing Newform.aspx
on 10-22-2008 5:45 PM

I have been able to customize the NewForm page with a dropdown list that is bound to a filtered data source. No errors are produced and I am able to create new items in the list and save them without issue. However, I am having trouble with getting the corresponding customization to work on the EditForm page.

The problem is that when I click on “Data Fields…” to bind the dropdown to the data source, the data fields for both display text and value do not show up in the “Change Data Bindings” dialog box. When I click the OK button, it then puts blank properties for these items as datatextfield=”" and datavaluefield=”". When I attempt to edit an item, I get a browser message that says “An unexpected error has occurred.”

If I then go back into the code and manually add the correct properties (which are datatextfield=”Flow_x0020_Addition” and datavaluefield=”ID”), I am able to open the item to edit it… however, when I make a change and then click save, I then get a browser message that says “Data Source Conflict: Your changes conflict with those made concurrently by another user. Refresh the form and submit your changes again.”

What am I doing wrong and/or what else do I need to do?

Adam Lowe wrote re: Lesson Learned While Customizing Newform.aspx
on 12-03-2008 2:00 PM

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.

adambenjaminlowe.blogspot.com/.../customizing-sharepoint-list-new-item.html

Mark Underhill wrote re: Lesson Learned While Customizing Newform.aspx
on 05-07-2009 4:43 AM

Very helpful. No other tip solved my problems with an edit form as this did. Thank you.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Need SharePoint Training? Attend a SharePoint Bootcamp!
Posts (c) their respective authors. Everything else (c) 2009 SharePoint Experts, Inc.