I am not sure if this behaviour is normal. I guess i have to investigate it another time. If you develop a listform using Visual Studio and based on an application page like i wrote in some other posts about it, you might notice, that in the edit and new form the save and cancel button does not work. They just do not firing the event.
The solution to this is really easy. In the schema file or by using code you change the listform url and also make the setting “UseLegacyForm” to true.
<form Type="NewForm" Url="NewForm.aspx" SetupPath="features\$SharePoint.Feature.DeploymentPath$\List1\NewSP.aspx" UseLegacyForm="TRUE" WebPartZoneID="Main"></form>
Doing so makes the save and cancel button working again, but now you have another stupid behaviour. Look at the screen: It is a generic / custom list as template, but it also shows buttons for edit series, claim release, distribution approval. What the hell is going on here?
There are several ways to customize a listform in SharePoint. I wrote already about this topic previously a post serie (three parts). In this post i’d like to show you a different way to create custom list forms. This time i write about the so called listfielditerator and the rendering template.
What is a listfielditerator?
This part of SharePoint is responsible for the outcome of each field. With the field iterator it is possible to change some rendering behaviour as well as using the method isFieldExcluded. This method is used to exclude fields from the form. MSDN Article
What is a rendering template?
A rendering template defines the outcome of the whole aspx page for the listform. By the way, if i talk about listform i mean the display, edit and new form of a list or library. Back to the rendering template which defines the controls that have to be loaded and how they look alike. It also contains the listfielditerator.
First in the solution we need a mapped folder to the controltemplates folder in the 15 Hive of SharePoint. In this folder the ascx file is created to define the rendering template. We have a teamsite, in which are already some lists. We will just create an easy custom list with some columns and change its form.
After that we need a code file (.cs) in which create a class which inherits from Listfielditerator. Let’s see the details: