I'm working on a SharePoint 2013-Solution which deploys a custom list with custom site columns and a custom form. In the list's Schema.xml I added following lines:

  <Form Type="DisplayForm" Url="DisplayVisitor.aspx" SetupPath="features\$SharePoint.Feature.DeploymentPath$\Visitors\DisplayVisitor.aspx" WebPartZoneID="Main" />
  <Form Type="EditForm" Url="EditVisitor.aspx" SetupPath="features\$SharePoint.Feature.DeploymentPath$\Visitors\EditVisitor.aspx" WebPartZoneID="Main" />
  <Form Type="NewForm" Url="NewVisitor.aspx" SetupPath="features\$SharePoint.Feature.DeploymentPath$\Visitors\NewVisitor.aspx" WebPartZoneID="Main" />

Inside the NewVisitor.aspx, I have a DataFormWebPart which XSL definitions etc. In general, I followed the description on this article: http://www.ilikesharepoint.de/2013/11/sharepoint-create-custom-list-forms-with-visual-studio-part-2/

The deployment works and the form is successful loaded when adding a new item, but after my DataFormWebpart, which is displayed the way it should, the default list form with all other columns is added automatically.

Default form is added after the custom DataFormWebpart

When inspecting the page, I can confirm that a second webpart is added automatically during deployment, but this should not happen. HTML inspection

How can I prevent SharePoint to add a default list form to the page, so that my defined DataFormWebpart is the only one form which is displayed?

Thank you for help!

2 Answers 2


I was able to use a custom form in place of the default one, without duplicated fields by applying the attribute


on my custom form registration. In your case that should become:

  <Form UseLegacyForm="TRUE" Type="DisplayForm" Url="DisplayVisitor.aspx" SetupPath="features\$SharePoint.Feature.DeploymentPath$\Visitors\DisplayVisitor.aspx" WebPartZoneID="Main" />
  <Form UseLegacyForm="TRUE" Type="EditForm" Url="EditVisitor.aspx" SetupPath="features\$SharePoint.Feature.DeploymentPath$\Visitors\EditVisitor.aspx" WebPartZoneID="Main" />
  <Form UseLegacyForm="TRUE" Type="NewForm" Url="NewVisitor.aspx" SetupPath="features\$SharePoint.Feature.DeploymentPath$\Visitors\NewVisitor.aspx" WebPartZoneID="Main" />

I would try to do the same, but I don't exclude there is a more appropriate way. That said, most of the tutorials I am aware of suggest this approach, so it is worth a try.

  • Now I get a UnsafeControlException: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe. Looks like it would work, but my DataFormWebpart does not work "alone"... Commented Dec 1, 2014 at 15:59

I found a Solution for this case. While using the attributes




did not add the default form webpart, SharePoint threw an UnsafeControlException. It looks like the DataFormWebpart on my NewVisitor.aspx could not be used "standalone" this way.

The final solution was following:

  1. Open SharePoint Designer and add a new form xslt webpart
  2. Replace its content with my DataFormWebpart from NewVisitor.aspx
  3. Remove my DataFormWebpart from ZoneTemplate of NewVisitor.aspx
  4. Select the WebPart and save it as .webpart file with the ribbon button
  5. Open it in text editor and insert the webpart definition to Schema.xml

enter image description here

  • will double-check my original code, I will let you know shortly.
    – SPArcheon
    Commented Dec 2, 2014 at 10:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.