Programming Microsoft ASP.NET 2.0 Core Reference
-
Both the DetailsView and FormView controls render a single record at a time from the associated data source, optionally providing paging buttons to navigate between records.
-
Both the DetailsView and FormView controls lend themselves very well to implementing master/detail views.
-
The DetailsView control has a fixed tabular layout and is formed by a few main areas a header, field rows, a pager bar, a command bar, and a footer.
-
The FormView control has areas such as a header, footer, and pager, plus a completely templated item area. You can define a custom form to render the contents of a single record.
-
The DetailsView control typically uses text boxes to render fields. If a particular field defines a template, any markup can be displayed. This feature is useful for representing dates and foreign keys through ad hoc controls such as calendars and drop-down lists.
-
Both the DetailsView and FormView controls support basic I/O operations such as insert, delete, and update. If bound to data source controls such as ObjectDataSource or SqlDataSource, DetailsView and FormView leverage the capabilities of the bound data source control to execute data-binding operations.
-
Both the DetailsView and FormView controls support two-way data binding through which data can be read automatically from a bound data source and also written back.
-
During updates and insertions, validation is possible in either of two ways. If templates are used, you can insert validator controls to sanitize the input both on the client and the server. If templates are not used, you can intercept events fired by DetailsView and FormView, control values being passed, and modify them at will or just cancel the operation.