Data Binding

So what is data binding? It’s a technique to fill a Asp Control with values from a source. This source could be an XML, or a database. Why would you want that? To create dynamic websites of course!
With data binding techniques, you can separate the way you make data visible, and the actual data.
More posts about this, you can find by tag.

Possibilities for the different Data Bind Controls

Repeater DataList GridView
Templates X X
Styles X
Columns X
Select Items X


Yes, to show the items from the collection or datasource, we will use templates. This is how we transform the data, to for example, a link. Every Control in the Data Controls, has his own set of templates it can use. What each template does, and wich control use them, you can see in the table below:

Repeater Control DataList Control
HeaderTemplate X X Text above all the items
ItemTemplate X X Each item
AlternatingItemTemplate X X
SeparatorTemplate X X Between items.
FooterTemplate X X At the end of the collection.
SelectedItemTemplate X


Styles help you with the layout, the colours. What kind of styles are there? A list:

  • ItemStyle
  • AlternatingItemStyle
  • SeparatorStyle
  • HeaderStyle
  • FooterStyle
  • SelectedItemStyle
  • EditItemStyle

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.