in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

David Wise's Sharepoint blog

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.

Published Nov 14 2007, 05:34 PM by DavidWise
Filed under:

Comments

 

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

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

November 19, 2007 8:25 AM
 

Parshuram Chenna said:

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

January 22, 2008 3:07 AM
 

DavidWise said:

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.

January 22, 2008 10:20 AM
 

CleverWorkarounds » More SharePoint Branding - Customisation using JavaScript Part 3 said:

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

February 28, 2008 6:57 AM
 

Tom Riddle said:

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

March 21, 2008 6:59 PM
 

SharePoint, SharePoint and stuff said:

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

May 5, 2008 8:47 AM
 

Mirrored Blogs said:

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

May 5, 2008 9:57 AM
 

Slappy said:

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

June 26, 2008 3:05 PM
 

JimR20 said:

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

August 28, 2008 8:19 AM
 

Mike Atkins said:

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!!

September 22, 2008 3:30 AM
 

David Goebel said:

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?

October 22, 2008 5:45 PM

Leave a Comment

(required )  
(optional )
(required )  
Add

About DavidWise

I have been writing software for over 16 years and web applications for 11 years. I have been also been elbow deep in SharePoint 2007 since Beta 2 and loving it! Currently, I work for Bennett Adelson Consulting (a Microsoft Gold Partner) based in Cleveland, Ohio.

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts