We use the FormView control for display a single record from the data source; there are seven types of Templates in which most of the Templates are optional.
You must create a Template for the mode in which the FormView control is configured. For example, a FormView control that supports updating records must have an EditItemTemplate defined.
Types of Templates:
-
HeaderTemplate
-
FooterTemplate
-
ItemTemplate
-
InsertItemTemplate
-
EditItemTemplate
-
EmptyDataTemplate
-
PagerTemplate
HeaderTemplate:
Header Template defines the contents which we want to display in the header row of the FormView Control.
FooterTemplate:
Footer Template defines the contents which we want to display in the footer row of the FormView Control.
ItemTemplate:
ItemTemplates defines the contents for the FormView row when it is in read only mode. This template basically used for display the existing data from the data source.
InsertItemTemplate:
InsertItemTemplates defines the contents for the FormView row when it is in insert mode. This template contains the input controls and commands for inserting the new record.
EditItemTemplate:
EditItemTemplates defines the contents for the FormView row when it is in edit mode. This template contains the input controls and commands for editing the existing record.
EmptyDataTemplate:
EmptyDataTemplate basically used for showing the alert to the user if there is no record in the bound column.
PagerTemplate:
PagerTemplate defines the content for the pager row when the "AllowPaging" property is true. It also contains the controls by using that, user can navigate to another record.