Data Binding Series

So what is databinding? 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 ofcourse!
With data binding techniques, you can separate the way you make data visible, and the actual data.
An overview of all the post in this series, you can find by tag.

You will be able to download the examples. They will all be in the 7ZIP format. In my opinion it’s the best archiving method, and it’s opensource. Check out the 7zip website if you are not able to open it.

Possibilities for the different Data Bind Controls

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

Templates

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

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

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

Download the examples

Repeater

This article is not yet finished.

Related posts:

  1. Add items to the Bulleted List Control (in the code file) My next tutorial will be a really short one. But...

Related posts brought to you by Yet Another Related Posts Plugin.







XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>