Você está na página 1de 3

Datalist:The DataList control is, like the Repeater control, used to display a repeated

list of items that are bound to the control. However, the DataList control
adds a table around the data items by default.

Repeter:1) Repeater Control is used to display repeated list of items that are
bound to the control and its same as gridview and datagridview.
Repeater control is lightweight and faster to display data when
compared with gridview and datagrid. By using this control we can
display data in custom format but its not possible in gridview or
datagridview and it doesnt support for paging and sorting.
2) The Repeater control works by looping through the records in your
data source and then repeating the rendering of its templates called
item template. Repeater control contains different types of template
fields those are
1) itemTemplate 2) AlternatingitemTemplate 3) HeaderTemplate 4)
5) SeperatorTemplate
3) ItemTemplate: ItemTemplate defines how the each item is rendered
from data source collection.
AlternatingItemTemplate: AlternatingItemTemplates is used to
change the background color and styles of AlternatingItems in
DataSource collection
HeaderTemplate: HeaderTemplate is used to display Header text for
DataSource collection and apply different styles for header text.
FooterTemplate: FooterTemplate is used to display footer element
for DataSource collection
SeparatorTemplate: SeparatorTemplate will determine separator
element which separates each Item in Item collection. Usually,
SeparateTemplate will be <br> html element or <hr> html element.

Details view:DetailsView control in ASP.NET is used to display single record at a time. You
can insert, edit, delete and paging the record in DetailsView.

ListView:The ListView is an extremely flexible data-bound control that renders its content based on the
templates you define. Unlike the Repeater, the ListView adds higher level features such as
selection and editing, which work in the same way as those in the GridView.

ListView is a new addition in ASP.NET 3.5. ListView can literally replace all other data binding
controls in ASP.NET. ListView control makes data binding easier than previous controls. It has
included styling with CSS, flexible pagination, and sorting, inserting, deleting, and updating
The most common reason for using the ListView is to create an unusual layout. For Example , to
create a table that places more than one item in the same row, or to break free from table
based rendering altogether. When building a page to display large amounts of data, ASP.NET
developers usually turn to the GridView first and use the ListView in most specialized scenarios.
ListView Templates:
Templates control certain aspects of the ListView control's generated HTML. Templates are
required with ListView; they are optional with other data controls. These templates provide
complete control over the output; that is, all aspects of the ListView's generated markup are
controlled via templates.
The following list offers details about the numerous templates available with ListView.

AlternatingItemTemplate: Defines how alternating items are displayed.

EditItemTemplate: Defines the presentation for an item when it is edited.
EmptyDataTemplate: Specifies the content to display for empty individual items.
EmptyItemTemplate: Specifies the content to display for empty group items.
GroupSeparatorTemplate: Specifies the content to display between groups.
GroupTemplate: Defines the content for groups. This template is a placeholder for the
data displayed for individual group items (when data is grouped).
7. InsertItemTemplate: Defines the presentation for a new item being inserted into the
data set.
8. ItemSeparatorTemplate: Defines the content to display between individual data items.
9. ItemTemplate: Defines the data to display for single items.
10. LayoutTemplate: Defines the main presentation features for the control. This root
template contains placeholders that are replaced by what is defined by ItemTemplate
and GroupTemplate.
11. SelectedItemTemplate: Specifies the content to display when users select items.

FormView control in ASP.NET is used to display single record at a time. You can insert, update,
delete and paging the record in FormView. There are seven types of template most of are
Template name are following: